Super Mario 64 Official Wikia

The Endless Stairs is an obstacle in Princess Peach's Castle, located at the top of the tower. They were used by Bowser to halt Mario in his progress.

Before entering the Big Star Door leading to the stairs, Bowser will warn Mario that he needs 70 Power Stars to bypass the obstacle. True to Bowser's word, if the player attempts to climb the stairs without 70 Stars, Mario will still enter the Star Door, but if he attempts to climb the stairs, it will be futile, as the stairs never seem to end, and it looks like the player never went anywhere. To make this illusion, the game warps the player back to a certain spot once they reach a certain part of the stairs. While climbing them, a creepy Shepard tone will be heard. Once the player gets 70 Stars, they will be allowed to climb the stairs and reach the final level, Bowser in the Sky.

In the DS remake, Super Mario 64 DS, the player requires 80 stars to reach the top. Additionally, since Bowser lets only Mario past, Yoshi, Luigi, and Wario are incapable of climbing the stairs and reaching the final level, regardless of how many Stars the player has.

To reach the top of the stairs with less than 70 Stars, players will have to use the infamous "Backwards Long Jump" glitch in the original game. Since the game keeps track of how fast Mario runs, if the players use the glitch, the game will be incapable of warping him back due to the absurd amount of speed Mario gets performing it. While the glitch was fixed in the DS remake, a different, out of bounds glitch can also be used, which allows the other characters to access the final level.