From the Super Mario Wiki
The Star Cursor is a cursor that appears on the screen in Super Mario Galaxy and Super Mario Galaxy 2. Its position is controlled by the wireless motion sensitivity of the Wii Remote, so the player can move it around the screen by aiming the Wii Remote at different angles. The Star Cursor enables the player to do many things, including collect Star Bits, shoot Star Bits at enemies to stun them, activate Pull Stars, and control Sling Pods. The player is able to collect large amounts of Star Bits at once simply by moving the Star Cursor over them. When the Star Cursor is used to activate Pull Stars, it temporarily changes to a hand icon, and changes back when there are no more Pull Stars to grab. It serves an important role in a few galaxies centered around Bubble Blowing, including the Bubble Breeze Galaxy and the Bubble Blast Galaxy; after Mario (or Luigi) has entered a bubble, the Star Cursor acts as a wind blower to propel the bubble along.
In multiplayer Co-Star Mode, a second Star Cursor appears. This cursor is orange, and allows a second player to perform all the tasks that the first player's Star Cursor can, along with some that it cannot. For instance, it can manipulate the environment and freeze enemy movement to aid the first player as needed. Both players pressing the button at the same time allows Mario or Luigi to perform the Co-Star Super Jump special move, as explained by the in-game instructions on how to use Co-Star Mode on the file selection screen of Super Mario Galaxy. Unlike the first player's Star Cursor, the second Star Cursor begins to spin when it is positioned over an object, item, character, or enemy in the environment that it can affect in some way.
In Super Mario Galaxy 2, the Star Cursor has essentially the same functionality as it does in Super Mario Galaxy, with some minor differences. For instance, the Star Cursor is replaced by a small red dot while riding Yoshi; while the player cannot shoot Star Bits as long as this dot is present, they can still collect Star Bits and point at enemies or berries that Yoshi can eat to produce Star Bits, as well as Flower Grapples that he can grapple on with his tongue. Additionally, in Super Mario Galaxy 2's Co-Star Mode, the second player's orange Star Cursor is effectively used to control the Co-Star Luma, which performs actions along with the Star Cursor where the Star Cursor itself would perform the actions in Super Mario Galaxy's Co-Star Mode. For instance, when holding an enemy back, instead of the player simply stopping the enemy's movement with the Star Cursor, the Co-Star Luma now flies to the location of the Star Cursor and visibly holds onto the enemy to stop its movement. The Star Cursor is slightly larger in this game than in Super Mario Galaxy.