Here's how and when Overwatch penalizes you for leaving games
Leave enough matches, and you'll be hit with a significant XP penalty.
You're free to leave a match of Overwatch whenever you wish, but doing so enough times can lead to a penalty. The specifics of how this work aren't explained inside the game, so Blizzard has offered a fairly detailed breakdown of how and when you'll be penalized.
Overwatch constantly looks at your 20 most recent games and compares the number of matches you've played with the number you've actually completed. If you're leaving too many and this percentage drops behind Blizzard's required threshold (the exact number wasn't shared), you'll be warned about leaving games too frequently. This message appears in bottom-left corner of the screen.
If you persist in leaving games after being warned, you'll be hit with a 75 percent XP penalty in future games. Leveling up is what rewards players with loot boxes, so that's nothing to scoff at.
This penalty remains in place until you've played enough games without leaving to bring that percentage back over the required mark. This is still calculated on your 20 most recent games, so it shouldn't be a tremendous burden to get back into Blizzard's good graces.
Lest you think you can circumvent this leaver penalty by disconnecting your Internet or getting yourself kicked for being idle, these things are still considered leaving. As such, you'll still end up being penalized if they happen often enough.
There are two times where you're safe to drop from a match: during the Assemble Your Team stage (before your team spawns in) and after seeing the Victory or Defeat screens. Quitting during the Setup phase treats you as a leaver.
It also adds that the threshold to trigger the XP penalty is "actually pretty high."
Some changes Blizzard is working on involve McCree, D.Va and Widowmaker balance adjustments. Overwatch's competitive mode will also be out later this month.