School of Evocation Wizards in 5E gain Overchannel at level 14. It states:

When you cast a wizard spell 1st through 5th level that deals damage, you can deal maximum damage with that spell. The first time you do so, you suffer no adverse effect.

If you use the feature again it gets progressively worse.

Do you have to announce that you are using Overchannel before or after determining if a spell hits or the target fails their save?

Something like: First, declare "I'm Overchanneling Chromatic Orb" (or hopefully something more flavorful)... Then, if it hits, it deals max damage but if it misses the Overchannel is wasted.

Alternatively, can you wait to see if the Chromatic Orb hits and then say, "Seeing its effectiveness I channel all of my energy to enhance it -- Overchanneling" (or again some other flavorful speech)