From the Super Mario Wiki
The game's purpose is to slide the door and open it to see what it hides. If done so, the game is won. However, if time's up and the hidden scene isn't seen yet or the camera reaches the door and it's not open yet, the player will lose the game.
Names in other languages