Game-winner markets are official after 5 innings of play, or 4.5 innings if the home team is leading when they come to bat in the bottom of the 5th.
If a game is called, the winner is decided by the score after the last full inning completed. The exception is if the home team scores to tie or takes the lead in the bottom half of an inning. In that case, the winner is decided by the score at the time the game is stopped.
Most other markets, including Run Line, Total Runs and Hits, need a minimum of 9 innings to be played (8.5 innings if the home team is ahead). Total Runs bets are the exception when the result has already been determined, such as the total having already gone over. MLB 7-inning doubleheader games need 7 innings (6.5 if the home team is ahead).
If a mercy rule is applied, the leading team is declared the winner and markets are settled accordingly.
For example: a game is called after 6 full innings because of rain, with the Blue Jays leading 3-1. A Moneyline bet on the Blue Jays wins. A Run Line or Over/Under bet on the same game doesn't stand, because the minimum innings weren't reached.
For more information, see the General Rules, Tickets & Wagers article.