Ok, all of the above answers were interesting but wrong.
The following are all made illegal under the New York City Administrative Code and the penalties for each of the following are as set forth:
Possession of a rifle/shotgun without a rifle/shotgun permit; possession of an unregistered rifle/shotgun (if you have a permit); possession of a rifle/shotgun ammunition feeding device with a capacity of more than 5 rounds (if you have a rifle/shotgun registered that accepts that magazine); possession of a pistol ammunition feeding device with a capacity of more than 17 rounds or that protrudes beneath the pistol grip (if you have a pistol registered that accepts that magazine); possession of any ammunition feeding device of any capacity (if you don't have a rifle/shotgun/pistol registered that accepts that magazine); and possession of ammunition (if you don't have a rifle/shotgun/pistol registered that accepts that caliber) --
It is a misdeameanor for all of the above, i.e., 1 year in prison + $5,000 fine + $10,000 civil fine. However, if it's your first offense, it is statutorily reduced to a lesser 15 (or 16 for some) days in jail + $300 fine + $1,000 civil fine.
Note that none of the above are crimes under New York State law, only New York City law.
Unregistered handguns are illegal under New York State Penal Code s.265. Generally, an unregistered handgun which is inside your house or unloaded outside your house is a Criminal Weapons Possession Fourth and Class A Misdemeanor, outside your house and loaded is Criminal Weapons Possession Third is a Class D felony.
And to emphasize, hi cap pistol mags up to 17 rounds which don't protrude out of the grip are OK in New York City (if you have a permit).
[Edited to correct the fine amounts as I typed those out of memory]