In common usage in the United States, a city is usually larger than a town. When I think of a city, I expect tall buildings. I expect to see mostly buildings and not trees when I look out of the window. I expect traffic jams. I expect museums and theaters. I expect a population of 100,000 or more.
A city can be called a "town" affectionately. "New York, New York, a wonderful town/The Bronx up and the Battery's down." "Chicago, Chicago, that toddlin' town." Even in a city one speaks of "downtown." If you live in New York and are going on a trip, you say "I'm going to be out of town next week."
When I think of a "town" I think population 5,000 to 100,000. A lot of residential areas. Not too many tall buildings.
As a technical matter, towns and cities have legal definitions. In the United States there are 50 different states and the laws are different in each of them. In New England, where I live, towns are a little unusual. In most states, there is space in between towns, "unincorporated" space that does not belong to any town. In New England, all the land in the state belongs to one town or another. As soon as you are out of one town, you are in another town. In New England, a "town" is run by a "board of selectmen" and a "city" is run by a "mayor."