A town is usually a place with a lot of houses, but not a city. As with cities, there is more than one way to say what a town is in different countries. In some places, it is a kind of local government.
In English, people also use the word "town" as a general word for places with a lot of houses (cities too). When they say "town" they are normally thinking of a big, important place. For example, London is a city, but people often call it "London town" ("the City of London" is a part of London where there are a lot of banks). Also, going from the outside to central London is to "go into town".
Generally, the difference between towns and villages or hamlets is the sort of economy they have. People in towns usually get money from industry (factories etc.), commerce (shops etc.) and public service (working for the town), not agriculture (growing food).
The number of people who live in a place does not tell us if it is a town or a village. In many areas of the world, like India, a big village can have many more people than a small town. It is also difficult to say if a place is a town because today, some towns are becoming bigger.
Sometimes a place is a city because it got the name "city" by law. However, people often call a place a "town" if it is small.
The United States
In the United States of America, the meaning of the term town is different in each state. In some states, a town is a town if the state says it is. In other states, like Wisconsin, a town is a subdivision of a county (same as a "parish" in Louisiana). In other states, like Michigan, the name "town" has no official meaning. People use it to describe any place with a lot of people.
In the six New England states, a town is a smaller part of the county. In all six, towns do things that, in most other states, the counties do. In many of these towns, town meetings are the main form of government, so citizens can say what happens where they live by direct democracy. In these states, the towns are really more important than the county. In Connecticut and Rhode Island, counties are only on the map and have no power. In the other four states, counties are mostly places with law powers. The counties with other functions are mostly in New Hampshire and Vermont.
In New York, a town is also a smaller part of the county, but it is less important than in New England. In New York, a town gives people more direct power than its county, giving almost all town services to places not in towns, called hamlets, and some services to places in towns, called villages. In New York, a town usually has some hamlets and villages. But, because villages have power without towns (they are independent) they can be in two towns or even two counties. Everyone in New York State who does not live in an Indian reservation (a special place for American Indians) or a city lives in a town, and perhaps in one of the town's hamlets or villages.
In Virginia, a town is similar to a city, but it can have a smaller number of people in it. By Virginia law cities are independent of counties (they have power without counties), towns are part of a county.
England and Wales
In the past, cities usually had a cathedral. Some English people think that a place with a cathedral must be a city, but it is not true today. For example, Northampton, Blackburn and Middlesbrough are all towns with a cathedral.
In the past, a place was usually a town, not a village, when it had a regular market or fair (a market, but not so often). There are some English villages (for example Kidlington, Oxfordshire) larger than some small towns (e.g. Middleham, North Yorkshire).