Those of us who study cities for a living define a city (roughly) as a continuously built up urban region that is a unified labor market, which means that from any point in the "city", a person should reasonably be able to commute to the central business district. This definition is starting to get stretched now that more cities are moving toward a more polycentric structure (that is, several employment subcenters), but usually there is a well-defined central business district. This definition has nothing to do with the formal political definition of a city, which is usually arbitrary. Think of cities as metropolitan areas instead.
All throughout history up to the present day, the most important limiting factor on city size is transportation infrastructure. Ancient cities were limited primarily by feasible walking commutes and secondarily by the need for defensive walls. Ancient Rome and other ancient megacities had very high population densities by modern standards, so much that severe traffic congestion (from pedestrians!) was a major problem. Transportation of goods is as important as transportation of people, and the logistics of bringing food and water into a city were also limiting factors to urban growth.
Contrary to common perception, density per se is not a significant limiting factor. The New York metropolitan area could easily house 100 million people in midrise apartments. But transportation would not work in that scenario.
Historically, major waves of urbanization have been driven by advanced in transportation. First, carriages, second, streetcars, and third, automobiles each brought about waves of expansion and lowered population density. Declining population density is a necessity, because faster transportation technologies also require more space, both in terms of the vehicle itself and in terms of greater road area swept out as the vehicle travels larger distances. Speed makes commutes longer, not faster. There is a principle known as Marchetti's constant which observes that in cities from the Neolithic to the present, city sizes are oriented around a half hour average commute.
Cities provide enormous external value. The wealth they create grows superlinearly in population in a phenomenon that economists call agglomeration economies, which is why people are willing to concentrate in the most prosperous cities despite the negative externalities of traffic congestion and other problems. The central cities of a nation or empire typically grow to the largest population they can while still being functional for this reason.
Today, the largest cities are in the tens of millions of people, and that is the highest possible with automobiles and conventional transit infrastructure. The largest metros such as New York City, Los Angeles, London, Moscow, etc. cannot expand out much farther because their exurbs are already at the upper limit of feasible commute time, and they cannot densify much or else they will choke on traffic congestion. Hence traffic congestion and housing prices are growing world problems.
This isn't meant to be fatalistic. Cities can still make smarter investments such as bus rapid transit, better dispersion of employment subcenters, and strategic upzoning on high capacity transit corridors to increase population and general functionality. In the long run, though, better technology is the answer to urban challenges.
I added the Megacities tech to model a new wave of urban expansion brought about by more extensive high speed rail networks, self-driving cars, and greater levels of telecommuting. Today China is planning an urban agglomeration in the Pearl River Delta (the
newly opened bridge is part of that project) that will bring up to 100 million people into a single unified urban labor market.
By the end of the Nanotech Era, flying cars and supersonic rails are common and cities can stretch hundreds of miles and house a billion people. By the end of the Transhuman Era, gravtrains and virtual transportation via mind uploading make a planet city, housing 100 billion people or more, feasible. In later eras, cities can span regions much larger than Earth. There is also the question of whether our "population" counts ems and other noncorporeal beings.
Getting back to game mechanics, there is the sticky issue that "cities" off Earth are not cities in the sense described above. By the end of the game a city can span billions of light years. If we restrict our attention to Earth, I don't see a good way to model the conurbation effects that come with better technology, and there isn't ever really an ecumenopolis in the sense of a single city. But I nevertheless think that allowing cities with billions of people in the future eras makes perfect sense. At least, it is no more far-fetched than anything else in the future eras.