I contact ground when told, and when clear of the runway. If tower has not told me to contact ground, when clear I say "Windy City XXXX is clear of runway XX". Then they usually say "taxi to the ramp with me" or "Contact ground". Either way, I always stay on tower until clear.
At MDW it's different, because tower will basically give us the taxi instructions when clearing. On the landing rollout, ATC will say, "Windy City XXXX, turn left Alpha, cross 31L, (possibly hold short 31L or hold short 22L) contact ground point 65." Then, when clear of 31L (another runway that is active) I'll call ground or wait for them to call me if the frequency is congested.
Know the procedures, but be flexible enough to recognize when things won't go "perfect by the book."