As most trees and shrubs develop next season's flower bud during the summer, pruning at this time will remove the flower buds. One client of mine has a large lilac against their house which has not bloomed. Their previous gardener had been pruning at the incorrect time and had removed all the flower buds!
For spring blooming trees and shrubs, pruning should be done immediately after flowering. This allows next season's blooms to form. Some examples include lilac, Nanking cherry, forsythia, and roses that bloom once per season.
Some trees are considered "bleeders" and will leak sap when pruned when not actively growing. They must be pruned during summer and early fall. Some examples include Birch and Maple trees.
Conifers usually don't require pruning except to produce denser growth or shorter stature. These are best pruned before the end of July. Pruning after this time can produce a dwarfing effect and also remove next season's buds.
If your plant has dead or diseased areas, these should be removed at any time. You do not want to allow any infections to spread throughout the plant. For diseased tissue, ensure removal of an additional six inches of healthy wood. Clean your pruning tools between cuts with an anti-bacterial product such as Lysol, and do NOT apply any wound dressings.