Most of the time, baseball teams play a single game on any given day. However, a few times a year they’ll play two games in a day. This is called a “doubleheader”, and it comes from the railroad term double-heading, in which two engines are used instead of one. This allows the train to carry a much larger load, or carry a standard load over steep inclines.
Most doubleheaders happen because an earlier game was rained out or otherwise postponed. So if the New York Mets travel to Atlanta to play the Braves and one of the games is rained out, one of their future games in Atlanta will be changed to a double-header. Nowadays this is usually called a day-night doubleheader, because one game is played during the day and the other at night. Such games are treated as two separate events. The games might be an hour (or more) apart, spectators are cleared from the stadium, and tickets are only valid for one of the games.
Sometimes, however, doubleheaders are scheduled on purpose, as a kind of “2 for 1” deal for the fans. These are called twi-night doubleheaders. Games are usually only 20-30 minutes apart, and tickets are valid for both games. Although twi-night games aren’t nearly as common in Major League Baseball as they used to be, they’re still popular in college and minor leagues. However, they don’t last quote as long, as doubleheader games only last 7 innings each in college and the minors.
And, just to be complete, you have the classic doubleheader, in which the first game starts early in the afternoon and the second game starts late in the afternoon. This came about due to the lack of stadium lights in baseball’s early years. Thus, the contrast with the day-night or twi-night versions of the game.
Were there ever tripleheaders? Yes. MLB records indicate that there were at least three tripleheaders: one between the Brooklyn Bridegrooms and Pittsburgh Innocents in 1890, one between the Baltimore Orioles and Louisville Colonels in 1896, and one between the Pittsburgh Pirates and Cincinnati Reds in 1920. Current MLB rules prevent tripleheaders generally, although they’re technically possible if a partial game was suspended and the only remaining games between the two teams are doubleheaders. So I suppose it would be more accurate to call it a “doubleheader and a half”.
There are some oddball doubleheaders out there. A home-and-home doubleheader is when two games are played on the same day, but in two different ballparks. Before interleague play began in 1997, there was only instance of a home-and-home doubleheader, and that was a special “gimmick” game between the New York Giants and Brooklyn Superbas in 1903. Since 1997, however, there have been three home-and-home doubleheaders between the New York Yankees and the New York Mets, each coming from an earlier game being rained out.
In 2000, the Cleveland Indians became only the second MLB team to host a doubleheader between two different teams. The September 10 game between the Indians and the White Sox had been rained out, and there were no more meetings between the two teams for the rest of the season. Normally, MLB would just tell them to forget the game, but since the White Sox and Indians were in a tight pennant race, the outcome actually mattered. So the game was played on September 25, with the Indians beating the Sox in the early game, but losing to the Twins in the late game.
Of course, baseball players used to be a lot tougher than they are today. In the early days of the game, it was common for a pitcher to play an entire game, even if he wasn’t doing so well. Although I can’t find the numbers for how many pitchers played two complete games in a single day, this site has a list of pitchers who pitched both games of a doubleheader… and won. It seems the last time this happened was in the American League on August 28, 1926.