What I explain to my students is that "hour" here is functioning as an adjective (even though it is normally a noun - you can find this general type of structure referred to as a "compound noun"). In English, adjectives do not have a plural form, so nouns functioning as adjectives are not usually used in the plural.
You would, however, make it plural if you said:
New York is a city that functions 24 hours a day.
Examples of other compound nouns that function in the same way:
- a three-year-old child
- a grocery store (NOT a *groceries store, even though it sells many kinds of groceries)
- a bookcase (even though it holds many books)
- a five-story building
There are some exceptions to this pattern, but not many.