While a game is in progress, the number can be found at the top of the screen.
Game IDs for Leagues
To find the game number of a League match, go to Account -> Game History once the match has completed, click the Details button by the relevant match, and click Replay Game. The game number will be listed at the top of the replay window.
Note: replays are stored locally on your computer, so if you reinstall Magic Online, it will start over with an empty Game History.
Wizards of the Coast staff may also sometimes ask you for a Match ID - a 9-digit number starting with a "2". For Leagues and casual games, you can locate that by going to Account -> Game History and clicking the Details button for the relevant match. The Match ID will be listed as the Event ID in those cases.