It is the Genitive singular. A "Nominative" phrase of a noun combined with a numeral uses the noun in different cases depedning on the last word of the numeral:
- 1: Nominative singular. E.g., одна школа; двадцать один дом.
- 2, 3, 4: Genitive singular. E.g., две школы; три дома; двадцать четыре этажа; тридцать три девочки
- 5 and everything else: Genitive plural: пять школ; восемнадцать школ; сто кошек.
There is no deep meaning in this system: it was born as an ad hoc solution when certain word forms disappeared (historically, Slavic languages had the "dual" number). So it "sounds right"—but would have made no sense were the Russian language to be designed from scratch a hundred years ago.
Russian only has one type, which is город (like most languages, really). There is no distinction between English "town" and "city", though when translating into English we usually call our towns towns if their population is small (e.g., Volzhsk or Chekhov) or cities if it is 100+ thousand people (e.g., Chita, Surgut or, well, Moscow)
It is purely for English speakers' convenience, because 20 000 or 5 000 000 people, these are all classified as город in Russian.