From the Super Mario Wiki
“AY-O! Did ya see that? Those Prankster Comets were green! That means there are Green Stars around now! Those must be the cosmic jewels I keep hearing about! Those Green Stars are pretty hard to find, so keep your eyes and ears peeled! Take it away, Captain!”
In Super Mario Galaxy, there are only three Green Stars, each of which is hidden away in a different galaxy. Collecting all three of them grants Mario access to the three Trial Galaxies on the Planet of Trials: the Rolling Gizmo Galaxy, the Loopdeeswoop Galaxy, and the Bubble Blast Galaxy.
In Super Mario Galaxy 2, there are a total of 120 Green Stars to be found. These are only available once the player collects 120 regular Power Stars and then completes the first mission of Bowser's Galaxy Generator again. Each galaxy has the same number of Green Stars as regular Power Stars (except the Grandmaster Galaxy, which has no Green Stars at all). When collecting Green Stars, the player will have to do a certain mission of a galaxy again. In some cases the Green Stars in a galaxy can be collected in any order (i.e. "Green Star 2" can be collected during the Green Star 1 mission), but in general they can only be collected when playing a Green Star mission. Green Stars are usually found in hard to reach or hidden areas of the galaxies. Additionally, the Green Stars only appear when a galaxy is orbited by a Green Comet, which will appear once they are unlocked.
Super Mario Galaxy 2's Green Stars make a distinct twinkling sound, which is different from that of normal Power Stars and the Green Stars in Super Mario Galaxy and is meant to help players in locating them.
Super Mario Galaxy Green Star Locations