From the Super Mario Wiki
Fortresses or Forts are fortified buildings that appear in many Mario games, starting with Super Mario Bros.. Usually, Fortresses are found at the end of levels. After reaching the Fortress, Mario or Luigi can advance to the next level. However, some fortresses, like the ones from Super Mario Bros. 3 and Super Mario World are made like castles.
In Super Mario Bros. 3, the fortresses that advance Mario to the next level do not appear. Instead, Fortresses are usually found in the middle of worlds. They are levels with Boom Boom as their only boss and he must be defeated to gain access to other parts of the world.
The End-of-Level Fortresses later return in New Super Mario Bros., New Super Mario Bros. Wii, New Super Mario Bros. 2, and New Super Mario Bros. U and reprise their roles from Super Mario Bros. as allowing Mario or Luigi to continue to the next level. There are also black fortresses when the player finds a secret exit.
The Towers in New Super Mario Bros. Wii are indirectly called Fortresses.
Appearances in Other Media
In the Mario Ice Capades, during the whole show, King Koopa rode a fortress that was surprisingly a moving one. A fortress also appeared in the background of the show as a prop. In The Super Mario Bros. Super Show!, a fortress appeared only in the intro.