In general, the principle is, prune when the plant is asleep (dormant) and does not have buds.

mulroelandscaping.com
The best time for pruning most trees, shrubs, and vines (if they do need pruning) is late winter and early spring unless they are early spring bloomers and already have buds.
The second-best time is summer. After flowering is the best time for spring bloomers.
Avoid fall. Pruning stimulates new growth and you don’t want this with winter on its way.
Dead, damaged, and diseased branches can be removed any time.
Trees and Shrubs
- Deciduous trees, evergreens, and non-coniferous shrubs handle pruning best in mid-winter when the sap is not running.
Avoid the heavy sap flow time in spring for trees like walnut and maple (and other trees you can tap for syrup). - The key for pruning flowering and fruiting trees and shrubs is to know when the plant fruits and whether it produces the fruit on old or new wood/growth.
The goal when pruning is to remove the old (and no longer useful or flowering wood) while protecting whatever parts are creating new flower and fruit buds.
Other Garden Perennials
- Many flowering perennials are best cut back (removing old, dead growth) in spring just as the new growth starts poking up.
While you could do this in the fall, you would be removing valuable winter food and habitat for wildlife (from microbes to birds and more), so wait if you can. - Trimming herbaceous growth like leaves on a boxwood hedge is done during the growing season (ending weeks before first frost).
Seasonal Pruning and Deadheading Calendar
1 Winter (while plants are dormant)
Remove dead, diseased or damaged limbs, suckers, overlapping or leggy branches.
- Deciduous, evergreen, and fruit trees.
- Shrubs grown for foliage (barberry*, burning bush, euonymus*…).
- Bush berries (blueberry, gooseberry, currants-oldest stems only).
*Beware of non-native invasive species.
2 Early Spring (some new growth may be starting to appear)
This is my main garden clean up time for the year.
- Summer-flowering perennials (daisies, coneflowers, black-eyed Susan’s…) – cut down last year’s growth.
- Shrubs that bloom on new wood (peegee and Annabelle hydrangeas- see the Hydrangea Pruning Guide here) – catch them in early spring.
- DO NOT PRUNE shrubs that bloom on old wood (previous year’s growth) or you won’t get any flowers. If you must, trim right after flowering.
- Ornamental grasses – remove old, dead growth.
- Roses – remove dead, damaged, or diseased branches only. Careful not to remove any new buds.
3 Summer
Flowering perennials and annuals – deadhead (remove finished blooms) to encourage a second round of flowers.
Trim and shape greenery like boxwood hedges up until 6 weeks before average first frost.
Once-a-year blooming climbing and old garden roses – deadhead after blooming is finished.
Clematis (not all types)- look up which type you have and use this pruning guide.
4 Late Summer / Early Fall (after flowering, before new buds form)
Remove dead, damaged and diseased branches only.
Hold off on deadheading perennials: wildlife including birds depend on perennial seed pods and old growth for winter food and habitat.
TIP: Put ribbons on any branches you need to prune when trees and shrubs are dormant in the winter.
Cane Berries (raspberries and blackberries) – remove two-year-old canes soon after they finish bearing.
Source: Pruning Tips for New Gardeners (Trees, Shrubs, and Vines) | Empress of Dirt