'in' is used with the names of countries and large towns; 'at is used when speaking of small towns and villages.
For example:
1. I live in Delhi.
2. I live at Indra Nagar in Lucknow.
In' and 'at are used in speaking of things at rest; 'to' and into' are used in speaking of things in motion.
For example:
1. He is in bed.
2. He is at the top of the class.
3. He ran to school.
4. He jumped into the river.