From the Super Mario Wiki
Star Coins are collectibles found in the New Super Mario Bros. games as well as Super Mario 3D Land and Mario and Donkey Kong: Minis on the Move. Three Star Coins appear in each level where some are easy to collect, while others require special power-ups such as the Mini Mushroom or the Blue Shell to access.
In New Super Mario Bros. there are eighty levels, thus there are 240 Star Coins to find in the game. Each Star Coin adds 1,000 points to the player's game score.
They also appear in New Super Mario Bros. Wii. In this game, there are 231 Star Coins. Three Star Coins appear in each of the game's seventy-seven levels much like New Super Mario Bros. Also, collecting one adds 4,000 points to the player's total score, instead of 1,000 like in its predecessor.
In Super Mario 3D Land, they also appeared, though with a slight name change to "Star Medal". Although they did not appear in Super Mario Galaxy 2 directly, very similar items called Comet Medals appear.
They have appeared in New Super Mario Bros. 2, where the name was changed back to "Star Coin". In this game, there are 219 Star Coins in total and they act relatively similar to the Star Coins featured in the original New Super Mario Bros.
 Super Mario series
In Super Mario 3D Land, Star Medals are the equivalent of Star Coins. There are three in every level, like in the New Super Mario Bros. games. They are used to unlock other courses, serving the purpose of Power Stars from past 3D platformers. The Star Medals have a similar appearance to Comet Medals from Super Mario Galaxy 2, but they have stars on them instead of comets. There are 285 Star Medals in the game's levels (including the Special Worlds), plus 51 in the Mystery Boxes, leading to a total of 336 to be collected. It is confirmed that through StreetPass Mystery Boxes the player can obtain 999 Star Medals although this serves no purpose as only 290 are needed to unlock all levels. When the player collects a Star Medal they have already collected in a level, they instead earn three Coins. Also, when the player opens a course with Star Medals, the players pay their medals, but they are refunded back to the player afterwards.
Star Coins reappear in New Super Mario Bros. 2. In this game, they are back to their original design. A similar type of coin known as a Moon Coin appears in World Star. These coins have moons from Super Mario World printed on them instead of stars, and do not count towards the Star Coin total.
Star Coins once again appear in New Super Mario Bros. U. Their purpose is the same as in New Super Mario Bros. Wii, where collecting all the Star Coins in each world unlocks a level in Superstar Road. There are in total 246 Star Coins in the game.
 Mario and Donkey Kong: Minis on the Move
 Names in Other Languages