In general, trim before the growth exceeds 1 foot. Hedges of slow-growing plants, such as boxwood, need trimming sooner. Excessive untrimmed growth will kill leaves beneath, and also pull the hedge out of shape. This is especially true with weak-stemmed shrubs. Deciduous material should be trimmed earlier than July, but after the spring flush of new growth, and will often need to be trimmed once or twice more.
Frequency depends on the kind of shrub, season, and degree of neatness desired.
If it is deciduous, the answer is fairly simple. In the spring, before leaves appear, prune to one foot below the desired height. Then trim carefully for the next few years to give it the shape and fullness desired. Rejuvenating evergreen hedges is more difficult. As a rule, evergreens cannot stand the severe pruning described above.