They are larger than normal coins, and depict a star. Each level contains three, which adds up to 240 of them in all, and they are used to open up paths on the world map and to buy Touch Screen background images later on in the game. They appeared again in the sequel, New Super Mario Bros. Wii. In New Super Mario Bros. Wii, they allowed you to buy hint videos. Also, when you collect all of the Star Coins in a world, the respective level in "World 9" will open. They appear again in Super Mario 3D Land (under the name Star Medals, which some people confuse for Star Coins) and New Super Mario Bros. 2. In New Super Mario Bros. U and New Super Luigi U, the easier ways to get them is with the Flying Squirrel ability, pink baby Yoshi, and platforms created by the Gamepad (if playing with a Wii Remote).
Usually, Star Coins are hard to reach, some include you need power-ups, like the Propeller Mushroom and Flying Squirrel, some coins require you to take the secret exit.