From the Super Mario Wiki
The Checkpoint Flag (also known as the Midway Flag or Halfway Flag) is a recurring object that signifies a checkpoint in several Mario games. They are similar to the Midway Gates from Super Mario World. If Mario, Luigi, Yellow Toad or Blue Toad loses a life after passing through a Checkpoint Flag, he restarts where the Checkpoint Flag is. If Mario or Luigi is Small Mario, the flag always restores him to Super Mario or Super Luigi. When the player touches a Checkpoint flag, they will be rewarded with 2000 points in some games.
New Super Mario Bros.
Checkpoint Flags first appear in New Super Mario Bros. as white flags with a picture of a Mushroom on them, though not all courses have them. They're not stuck on the ground, and appear suddenly when Mario reaches a checkpoint zone. If Mario loses a life, he will restart the course from the flag.
New Super Mario Bros. Wii
Checkpoint Flags reappear in New Super Mario Bros. Wii. In this game, they appear as black flags with Bowser's symbol on them. When Mario, Luigi, or one of the Toads touches one, the flag changes from a Bowser symbol to the character's symbol, receiving 2000 points. Additionally, if Mario is currently Small Mario, he becomes Super Mario when the Checkpoint Flag is activated, similar to the checkpoints in Super Mario World.
As a side note, if Luigi or one of the Toads were to activate a checkpoint flag, everybody were to lose a life and the character who touched the flag drops out of the multiplayer session, the players must start over from the beginning of the level
Super Mario Galaxy 2
Checkpoint Flags reappear in Super Mario Galaxy 2 and feature almost the same appearance and function as in New Super Mario Bros. Wii. As in that game, when Mario or Luigi touches a flag, the Bowser symbol changes to their respective symbol (a "M" or "L" symbol). Depending on which galaxy the player is in, there may be anywhere from one to several Checkpoint Flags positioned between the beginning and the end of the level. Some levels, such as "The Perfect Run" in the Grandmaster Galaxy, may not feature any Checkpoint Flags at all. In addition to having Checkpoint Flags activated by Mario or Luigi themselves walking into them, they can also be activated by the Co-Star Luma or by Yoshi's tongue.
Super Mario 3D Land
Checkpoint Flags, having the same design as the ones from Super Mario Galaxy 2, appear in the Nintendo 3DS game Super Mario 3D Land. In this game, the flags turn Small Mario to Super Mario, like before. They serve the same purpose they did in the previous game and like before, some stages like World 2-1 may not have Checkpoint Flags at all.
New Super Mario Bros. 2
Checkpoint Flags reappear in New Super Mario Bros. 2, similar to how they appear in New Super Mario Bros. Wii, giving the player 2000 points and replacing the Bowser symbol with either a "M" or "L" symbol. In Coin Rush, touching the flag does not give points, but adds 50 or 100 seconds to the time limit. Like past titles, they turn Small Mario into Super Mario. They also do not appear in every level of the game, like in Rainbow Courses and Cannon Courses.
New Super Mario Bros. U
Checkpoint Flags appear in the Wii U game, New Super Mario Bros. U. The flag is tied around the pole this time. There are two checkpoint flags in one stage in the game.
Super Mario 3D World
Checkpoint Flags reappear in Super Mario 3D World, serving the same function as in previous 3D Mario platformers and back to their original design. As in home console New Super Mario Bros. games, the color of them corresponds to the character who touched it, as well as their emblem, which means Mario and Luigi have red and green colors, respectively, with the same letters as their cap shows (M for Mario, L for Luigi), Peach's Crown appears for Peach and has a pink flag, while Toad has a blue flag and shows his face, and Rosalina's cyan colored flag shows a Grand Star.
Names in other languages