At which point does a game count towards my stats?

Solution 1:

As soon as the timer ends, so when the slow down starts and the Victory/Defeat message appears.

Source : if you're about to get a level, as soon as the game ends, if you pause, you should be able to see the "Open Loot Box" option.

Solution 2:

I don't have any concrete evidence of this, but since the Leaver, Experience, and Achievement systems count a game as complete as soon as Victory or Defeat appears, I'm guessing that's also when your stats will be updated.

The flip side of this is that Blizzard is trying to encourage players to stay until the end of a match, so chances are your stats won't update prior to that.