There is no clear rule on what makes a city a city or a town a town. Forget about trying to classify them by population. At least in the United States, the terms 'city', 'town', and 'village' vary wildly and regionally. The designation is largely determined by differing state standards, and is often based on the form of local governance, rather than population.
For example the state of New York has about 61 cities, and roughly 555 villages. In the state of New York, a 'town' is an
geographical area of governance, and may include multiple villages, or may include no villages. In the state of New York, if you don't live in a city, you live in a 'town', even in you happen to live in completely rural location. Towns in the state of New York are more akin to a county (and often follow county lines). The
populations of those villages range from hundreds of thousands down to just a few hundred people, yet they're all 'villages'.
Contrast that to my state of
Kansas, where classification is far simpler, and everything is a 'city'. Populations of those 'cities' range from around 400,000 down to about 15. Up until 2017, the smallest 'city' had a population of 5, but the residents decided to become unincorporated, so they're no longer officially a 'city'. I grew up on a farm, but the closest 'city' (about 10 miles from our house) had a population of 30. The nearest school (where our mailing address was out of) was in a 'city' of only about 350 people.
In my neighboring state of
Oklahoma, they do use population as a rough guideline - any incorporated municipality with a population of 1,000 or more is a 'city', under that and it's a 'town'. Note that there are several 'towns' with single-digit populations as low a 2.
That's just how three states handle naming conventions; the other 47 states have rules which vary just as widely.
In addition, the way people refer to a municipality colloquially often differs from its official designation. For example, even though my tiny hometown is officially a 'city', we always spoke of driving to 'town' not the 'city', or needing to go to 'town' to buy groceries, for example.
The only way to know the official classification is to look up the location in question. Colloquially, towns are typically smaller than cities, regardless of the official classification. When the distinction gets blurry, you just kind of have to go by whatever term locals seem to use if you really think it's that important (which it likely isn't.)