Only bad times:
*Right after the trees have put on a new flush of growth in the spring, you don't want to remove a notable percentage of the leaves. essentially, the tree/shrub just used its"savings" account to invest in making a bunch of food factories. You want to let the tree/shrub get a return on its investment before removing those factories.
*Oak and Elm (DED-susceptible species/cultivars) should never be pruned during the growing season.
There are a few other exceptions, but those are the big ones.
Fruit trees: prune while dormant, ideally...but not "necessary".