From the Super Mario Wiki
Star Markers are types of stars found in Super Mario 64 and its remake Super Mario 64 DS. These star-shaped shadows mark the spot where a Power Star appears once Mario collects all eight Red Coins in a level. The Power Star is only obtainable once the eight red coins have been collected. Once Mario obtains all 8 red coins however, the Star Marker will still be under the Power Star.