This is one of the most asked questions us arborists deal with. The answer is simple… When the tree is dormant. Or otherwise when the leaves fall off. This time adds the least amount of stress to the tree when it is trimmed. And more importantly, if your tree is one that is more susectipical towards fungal diseases, then fall/winter would be the ideal time.
Even trees that don’t fall ill towards a fungus have a better time with dormant trimming than during the growing season. This way the tree has time to heal and recover before any bugs start in on it. Bugs do tend to go after stressed trees. And trimming, though needed, is a stressor.