From the Super Mario Wiki
Ghost Houses, listed in the Super Mario World manual as Haunted Houses, are large buildings where Boos and other ghosts live. They first appeared in Super Mario World and soon appeared in later Mario platformer games such as New Super Mario Bros. and New Super Mario Bros. Wii. Unlike most other Mario series levels, Ghost Houses are primarily puzzle-based, requiring the player to find the correct path in order to progress.
Super Mario series
Super Mario World
Ghost Houses first appeared in Super Mario World, where there were six Ghost Houses in Dinosaur Land: two in Donut Plains (one secret), one inside the Vanilla Dome, one in the Forest of Illusion, one on Chocolate Island, and one in the Valley of Bowser. As with Castles, Yoshi will stay outside of the Ghost House when Mario or Luigi enters. The given reason is Yoshi's fear of ghosts, but the technical reason is because the doors inside Ghost Houses (and castles) can't be entered while riding Yoshi, and some enemies located inside do not work properly with Yoshi.
Whenever Mario completes one, the game can be saved, regardless of whether the stage has already been beaten. As Mario can replay the ghost house stages at any time, this is an easy way to save the game whenever the user wishes.
New Super Mario Bros.
Several Ghost Houses appear in New Super Mario Bros.; these introduced more new ghost species such as a Phantom Hand and a Broozer. The game also introduced the Ghost House quirk of having Boos cover up the bottom screen while Mario or Luigi were inside Ghost Houses. There are four in the game, located in World 3, World 4, World 5 and World 7.
New Super Mario Bros. Wii
The Ghost Houses from the previous game re-appeared in New Super Mario Bros. Wii, this time with Boos flying around them, just like in Super Mario World. They are located only in World 3, World 4, World 5, World 7 and the Coin Battle World. Some Ghost Houses introduces new enemies like Scaredy Rats and Ghost Vases and most of them have many fake walls.
Super Mario 3D Land
In Super Mario 3D Land, Ghost Houses function in much the same way as in the previous games. They are found in World 4, World 6, World 8, Special 4, Special 5 and Special 6 of the game. On a side note, Boos no longer cover up the bottom screen because the map isn't shown. There are new enemies, including Tail Boos and Peepas. The Ghost Houses in normal worlds end with a "fight" against a Big Boo where the player must get past the Big Boo and exit the Ghost House.
New Super Mario Bros. 2
Ghost Houses reappear in New Super Mario Bros. 2 for the Nintendo 3DS containing Boos, Peepas, and the colossal Boohemoth. There are 7 Ghost Houses in the game, one in each world, excluding World 1 and World Star. Like New Super Mario Bros., Boos once again cover up the bottom screen when Mario or Luigi is in a Ghost House.
New Super Mario Bros. U
There are four Ghost Houses in New Super Mario Bros. U: One in Sparkling Waters (similar to the Sunken Ghost Ship from Super Mario World), one in Frosted Glacier, another in Soda Jungle, and one in Meringue Clouds. Soda Jungle's haunted section features haunted courses like Painted Swampland. There is also a Ghost House-related Challenge Mode course, The Haunted Propeller.
Super Mario 3D World
Ghost Houses also appeared in Super Mario 3D World. These ghost houses are not really puzzling, meaning they are like other courses, excluding the Ghost house in World Flower. A new power-up can be used to defeat ghosts called a Light Box. Ghost houses appear in World 3, World 6, World Bowser, World Star, World Mushroom and World Flower.
The mansion of Big Boo's Haunt of Super Mario 64 is a Ghost House. Sirena Beach's Hotel Delfino is similar to a Ghost House in many ways, as Desert Land's fortress as well in Super Mario Bros. 3. Ghostly Galaxy from Super Mario Galaxy contains a ghost mansion which Luigi is kept in. Boo Mushrooms appear as well. In Super Mario Galaxy 2, two Ghost Houses exist. The first, Haunty Halls Galaxy, features a ghost house that is invisible and intangible unless Yoshi eats a Bulb Berry. The second, Boo Moon Galaxy, features a pop-up book with a ghost house, as well as a graveyard, and a ghost tower where Mario becomes Boo Mario. A Ghost House also appears as a K'Nex building set for Super Mario 3D Land.
The level Ghost Mansion in the game Yoshi's Safari is a large Ghost House. The level is full of Boos, Lava Bubbles, Nipper Plants and a Lakitu boss that Mario and Yoshi must shoot down with the Super Scope. Mario and Yoshi will eventually reach the end to face Big Boo, the level's main boss.
Paper Mario series
Boo's Mansion of Paper Mario and Creepy Steeple in Paper Mario: The Thousand-Year Door is a Ghost House. The Enigmansion, found in Paper Mario: Sticker Star, acts like a Ghost House until the Boos are removed, of which it becomes a peaceful mansion. However, the Scaredy Rats remain. Also for Merlee's Mansion (chapter 2-4) is like a ghost house for mostly rooms (e.g. not the bathrooms).
Mario Party series
The boards King Boo's Haunted Hideaway from Mario Party 8, Boo's Horror Castle from Mario Party 9 take place inside Ghost Houses, that are inhabited by Boos and Scaredy Rats, appear with other creatures. Minigames that feature Ghost Houses are Locked Out, Eye Sore, Candlelight Flight, Light Up My Night, Ghost in the Hall, Boo-ting Gallery, Specter Inspector, Manor of Escape, King Boo's Puzzle Attack, Boo-Bye, Boo Tag, Peek-a-Boo.
Dance Dance Revolution: Mario Mix
In Dance Dance Revolution: Mario Mix, a Ghost House is found in Wario's Carnival. Though this so-called "Ghost House" is actually a traditional false haunted house (as seen in several real world carnivals), it actually contains Boos.
Names in other languages