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. When they say "town" people are normally thinking of a big, important place. It may even be a city.
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.