A regulation Major League Baseball game lasts nine innings, which usually takes about three hours to play.
Each inning is split into two halves, the top half and the bottom half. In each half, the team playing defense (and pitching ) stays on the field until they’ve recorded three outs against the batting team.
There are no time limits on the length of an inning, which could theoretically go on forever. Generally, though, each half inning lasts 10-15 minutes.
In MLB, the visiting (away) team bats in the top half of each inning, while the host (home) team bats in the bottom half of each inning.
As with the duration of an inning there is no time limit on the duration of a full game (although umpires and other officials do have some discretion in “calling” a game after an exorbitant number of innings or elapsed time).
It should be noted that the average length of a major league game has increased steadily over time, from less than two hours as late as 1946 to a shade over three hours in the 2020s.