Ignore the "9,000" answer — that is a joke, not a count. The Magma Cavern has roughly 25 floors, plus 3 upper floors.
The upper section is worth calling out specifically, because that is where Groudon is waiting. If you are climbing the cavern hunting the legendary, the 3rd upper floor is your destination, and knowing that saves a lot of aimless wandering through the main stack.
So the structure is 25 floors of cavern proper, then three more above them, with the encounter at the top of that. Anyone quoting a four-digit number is either messing with you or has confused the floor count with something else entirely.