All those who claim Mario games store their levels in a 2D array structure of some kind are way off: aside from the first two GB Mario games (and possible the third), the Super Mario games are object based.
Each level is split up into several screens, with the total size for each level being the same. Each screen contains a variable length list of objects, each with a type, position, and (depending on type) other properties. At the start of a level, the first screen or two is interpreted and converted to a regular 2D array structure that's used to draw the screen and do interactions. As the level scrolls past, this map is rebuilt on the fly, throwing away the parts that go out of range.
This is why enemies can respawn if you backtrack, most notably in one of the forest levels in SMW where you can use the cape to jump back and forth three screens wide from one caterpillar to another. Which incidentally, because you never touch the floor, gives a lot of lives.
The specifics of this system differ between games ofcourse.
Other than that, Martin Harris is completely right.