Original version of The Sims 2 allow you to built up to 5 levels. This means houses like basement + 3 floors + roof or terrace. You can eliminate the basement, or built an underground floor inside basement. There is a TRICK that allow building 6 levels: put a dormer on the highest level, but this will not allow anymore stepped roofs taller than one floor.
University Expansion Pack allows to change the floor limit: press Ctrl+Shift+C when you are in Neighborhood (NOT in a lot), type sethighestallowedlevel 16 (or any number up to 255), then open any lot and you can built more levels. If the height limit was reached, just put a dormer to unlock the limit.
BEWARE! the game will crash when you reach a certain height, of 16 levels if you use basement or 15 levels if you do not use basement.
In neighborhood views you will not see floors tiles higher than 150 steps from street level. Each floor have 16 steps and foundation normally have 4 steps, 16 steps x 9 floors = 144 steps, you can use raise ground or use foundation of max 6 steps, however ground floor raised at levels not divisible by 4 cause a ugly look in neighborhood, so when you are building skyscrapers you should stick at 4 step foundation and 9 floors.
The towers shown in above photos show max possible building height (pink skyscraper, basement + 15 floors), and highest flooring which appears in Neighborhood view (green skyscraper, basement + 9 floors) so the roof flooring is at 11th level.
You can also create a huge hole in the ground and by this way you can have the floor tiles displayed even at 16th level (the game crash at 16 levels regardless of the height from street level), but again will look ugly.
Alternatively, you can use pitched roof to cover tall buildings, see through windows that internal floors are not displayed above 10th level.
Lots saved with University expansion pack, regardless of number of floors, can be open and played in any other version of The Sims 2 including base game, any University object is deleted rather than crashing the game, the single “problem” is that the University lots viewed in base game have crazy prices, even negative prices, like $-987,123,456.00, you need to enter in lot and save lot in base game, then you can play a base game lot with 16 floors.
This is not working for newer expansion packs, from Nightlife to Apartment Life, each having own version for saved files, and trying to open lots without required expansion packs will crash the game.
The Sims 1 allow you to build 1 or 2 levels only, lower and upper level, and no foundation. Roof is added automatically over any enclosed area of house.
The sims 3 allow you to build up to 6 levels, 6th level cannot hold walls but only roof or terrace. Foundation and frieze (a 4-step tall zone that divide floors) also count as levels. So you can for example build a house with basement and 4 floors plus roof. World Adventures expansion pack add option to build basements, up to 4 levels underground. But for efficiency you shouldn’t have more than 2 habitable floors, otherwise your sims will waste a lot of time going from one task to another.
The Sims 4 allow you to build up to 4 levels above ground and 2 levels under ground (basement). Foundation does not count as level, it is added automatically over entire house and you can adjust it from 0 to 9 steps even after the house was built.
There are no cheats for The Sims 1, 3 and 4 to raise the number of floors limit, like in The Sims 2.