The Exit door is where the ninja must go to complete a level. It is locked by default, and opens after touching the exit switch.
Reaching an opened exit door saves your amount of time and gold collected in the level. When playing an episode, it allows you to carry them over to the next level.
Touching an opened exit door is enough to complete the level, even if the ninja dies in any way afterward.