I'm a year round bike commuter, and I live in the Bronx. My old commute to school was five miles each way during the week, and 15 miles to work on the weekend. At my new job the commute is shorter during the week - about 2.5 miles each way.
Yes, it is illegal to ride a bike on the sidewalk. Three years ago I got a summons for riding my bike on the sidewalk along Boston Road in the Pelham Parkway section of the Bronx. As other posters have already noted however, more often than not the sidewalks are too congested to ride on. Studies have also shown that it is more dangerous to ride on sidewalks as well. If you're traveling at any kind of real speed you're liable to hit a pedestrian, or get hit by a car at intersections.
I would recommend you go to your local bike shop and get a copy of the NYC bike map. It's a very big, two sided detailed map of the city which shows you which streets are good to bike on (bike lanes, low traffic, ample shoulder) and which ones to avoid (high traffic, little room).
I'd be happy to answer any of your questions here, but I'd also highly recommend
Bike Forums - lots of very experienced cyclists in NYC and other parts of the country who can give you invaluable advice.