When humanity has substantial populations on many planets, megacities will probably be a natural occurrence on some of the older planets. Some would argue that we already have them; though they're admittedly a bit less sci fi than the ones you're probably thinking of.
Environmental collapse, and other factors can create science fiction style megacities even before we successfully colonize other planets.
Below is a collection of some of the more inspiring megacity art from around the web. You'll quickly notice just how much properties like Blade Runner have inspired this space.
The buildings are huge, it's dark, and there's a fair amount of neon. It's a classic science fiction megacity, but a beautiful one.
A less cyberpunk take. It speaks a bit more to the society progressing in a steady and orderly manner. There's probably less inequality in a megacity that looks like this, but I'm sure still plenty of dark stories.
Can it be a megacity if it's spread out? If the only thing other than the city is dirt, I think so. The manufactured/protected greenery in the center has a very Central Park in New York City vibe, but on a massively different scale.
The thing that I really enjoy about this image is the interaction between the ship and city, and that effectively makes it an image about a city, at least for how I look at it.
The ship could be for any number of things. I first think of a police presence. For any type of megacity, a normal sized police response isn't going to work if an entire block is revolting, or needs to be suppressed. This guy will do it.
But you could also imagine it as a giant pleasure vessel; or something inhabited by the rich and famous of this society.
A color we don't normally associate with megacities. White. It's typical that the high/pure/clean factions of humanity, or alien races of that type build less close together. I enjoy that this image challenges that trope.
One of the features that I really like about some megacities is a single, or a small set of equally mega-sized structures in them. I most commonly think of Blade Runner when I think about that, and this image is a great example of that same kind of feeling, just a bit less dystopian.
The buildings having a more organic, or crystal-like shape gives this one a more alien or machine feel.
Here's one that's a bit more sad. A few man made lights, but not nearly enough to make up for the amount of natural light these skyscrapers are blocking.
You an imagine the oppressive regime that controls this place. Or some planet-wide hardship taking the light and hope away from its people.
If you click through to the author's page, there's actually a short video for this one!