The word "city" can refer to any populated area. Places with only a few thousand people are routinely called "cities". I used to live in a town with a population of about 15,000, and the signs on the roads as you approached said "city limits", it was officially called "City of ...", etc. Likewise if you're filling out a form asking for your address and it says street, city, state, zip code, even people who live in the smallest communities rarely hesitate to fill in the name of that community. I've never heard someone ask, "What should I put here? I live in a small town, not a city."
However, "city" is also used to refer specifically to places with particularly large populations, as distinguished from a small town, suburb, or rural area.
So it depends on the context. If you asked someone, "What city do you live in?", people would normally understand you to mean a community of any size. But if you said, "I want to live in a city," people would probably understand you to mean a heavily-populated place. If you asked, "Do you live in a city?", someone who lived in New York or Los Angeles would immediately answer "yes"; someone who lived on a farm would answer "no"; and someone who lived in a mid-size town would probably ask what you meant.
You could say "community", but this is sometimes understood to mean a sub-division within a city or town.
"Populated area" might work, but is awkward for general conversation. It's not normally used to refer to a specific place, like you could say "the city of Boston", but you wouldn't say "the populated area of Boston". (You might say "the populated area of Detroit", to distinguish it from the areas that are empty as the people all move out. :-) But that's another story.)
Ah, given that you say that you just need to know what to call a certain part of an address in a database: I think the simple answer is, What country is this system to be used in? Then see what they routinely call it in that country. I suggest you go to the website of the postal service of the desired country and look for instructions on how to properly address envelope. In the US and Canada, we routinely call this part of the address the "city". In Britain and Singapore, its "town". In Australia, its "suburb". Etc. I suspect if you said "city" or "town" in the context of an address form, people in any English-speaking country would know what you meant.