Hydrangeas usually do not need to be pruned if one puts them in a location or in a pot where they will attain their estimated size at maturity. However, potted hydrangeas sold by florists and grocery stores often do not include this information. In those cases, assume that the shrub will get to 5-6' (height and width). If you live in the South, where the growing season is longer, expect a bigger bush by the time the plant goes dormant in the Fall (or Winter). If you live in the North, where the growing season can sometimes be shorter, expect a smaller bush size by the time that the plant goes dormant.
If you see any stems that do not leaf out by the end of May, those stems can be cut down all the way as they will be dead.
If you see stems that cross or if you want to let some sun in the middle of the shrub, you can prune those too but when to prune depends on the type of hydrangea. Mopheads normally produce invisible flower buds in July-August (July in the South and August in the northern states) and these then open in the Spring. So do not prune them on or after July-August. Instead wait until after they have bloomed (so you can enjoy the blooms) but before the end of June. So-called "reblooming" mopheads will have another flush of blooms in the Summer or Fall.
Deadheading, which means cutting off the spent blooms, is a different story. You can deadhead the blooms at any time.Or let Mother Nature do it for you. Some people leave them "on" for winter interest. Others deadhead them as soon as they change color (for example, some people want blue blooms ONLY and deadhead the blooms as soon as the blue blooms turn green-ish or pink-ish or green/pink-ish).