Major League Baseball has no clock and no curfew. A game ends when the required innings are completed and the trailing side has made its final out — not when a set amount of time has elapsed. This is one of the sport's defining quirks, and it is why a game can run two hours or five.
Umpires do have discretion to suspend or call a game for conditions rather than duration. Rain, snow, darkness, or an unplayable field can stop play, and once a game is official it may be resumed later or ruled final. If a match is already underway and heads into extra innings, it continues until somebody wins; there is no cut-off that ends it in a tie at the professional level.
Time limits do exist elsewhere in the sport. Youth leagues, travel tournaments, and some amateur competitions use a drop-dead time or a run-ahead rule to keep events on schedule, so always check the local rulebook.