From the Super Mario Wiki
A Star Door in Super Mario 64.
Star Doors are doors in Peach's Castle that appeared in Super Mario 64 and its sequel Super Mario 64 DS. Like most locked doors in these games, a certain number of Power Stars must be obtained before they can be opened (although Star Doors require many more Power Stars than regular doors). Once unlocked, the doors will slide open allowing Mario to enter.
Four star doors exist in the games:
- The first floor door leads to Bowser in the Dark World. Eight (12 in remake) Power Stars are required to open it.
- The second door is in the basement and requires 30 Power Stars to open and holds (Dire, Dire Docks and Bowser in the Fire Sea are behind it.)
- The third door is on the floor above the lobby at the top of the stairs. 50 Power Stars are needed and behind it are Tick Tock Clock, Rainbow Ride, and Wing Mario Over the Rainbow.
- The last door leads to the final battle with Bowser. It doesn't require any Stars to open, but has a staircase that never ends unless Mario has at least 70 Power Stars (80 in remake) to be unlocked.
- If Mario attempts to open the final door without 70 Power Stars, a message from Bowser will appear and the door will open. Mario can then enter the door, but will be deterred by the Endless Stairs (the Backwards Long Jump can be used to bypass these, allowing Mario to enter the final level).
- In the remake, if anyone other than Mario attempts to open the final door (80 Power Stars or not), they will still encounter the Endless Stairs.
- Only Mario can open Star Doors. However, once they're open, anyone can enter them.