To answer your title question directly: It depends on the sentence.
In the example given, no comma is needed; whenever possible is an adverbial phrase modifying act as a team that has been inverted from its normal word order for emphasis. The sentence can be grouped logically as
The best way to X is to remember that Y.
Clearly there is no comma needed after the that in this construction. We are only concerned with the punctuation of Y, which is:
Whenever possible, all adults in a child's life should act as a team.
If you didn't place the adverbial phrase at the front, it would be
All adults in a child's life should act as a team whenever possible.
In that arrangement, you could make an argument for inserting a comma. I would say that both in the example's inverted form and in the standard post-position without the comma, it reads more as an admonition, imparting the sense that you should be seeking every opportunity to make it possible; while with the comma it reads more as a simple concession that the speaker knows it won't always be possible.