It really does depend on where one is in NYC. As George mentions - there are a number of boroughs here (5). And all of the boroughs (including Manhattan) do have a mix of housing - including single family, detached homes. Those homes are a bit more rare in Manhattan - but they definitely do exist. In Manhattan, these homes can range from (and would be generally categorized as) brownstones, townhouses, rowhouses, mansions - depending on structure, where located, etc.
I currently live in one of the boroughs outside of Manhattan, relatively short commute via Henry Hudson Parkway.. In my neck of the woods, these are a few of the houses currently for sale:
Q