It depends what kind they are. Paniculata forms can be pruned to size or shape at any time of year except once they've begun forming their flowers in summer. Best done in early spring to remove any frost damaged stems or immediately after flowering to improve shape.
Mopheads and lacecap hydrangeas should have spent flowers removed as soon as they go over or by the end of July before they set buds for next year's blooms. Just remove the flowers by hand without damaging the bud forming below. They can be pruned at any time to remove dead stems. Removing any other stems to tidy up the plant or reduce size will reduce flower power as they flower on old wood so bear in mind that any new stems will not flower till their second year.