Map from Google - New_York

The climate of New York is continental, with cold winters and hot summers.
The average temperature in January is 0.5 °C (33 °F), that of July is 24.5 °C (76 °F). Here are the average temperatures.
Average temperatures - New York
New YorkJanFebMarAprMayJunJulAugSepOctNovDec
New YorkJFMAMJJASOND
Min (°C)-3-22712182020161050
Max (°C)451016222629282418126
Min (°F)272836455464686861504132
Max (°F)394150617279848275645443

The city lies on the coast, but it's also on the edge of a continent that cools down in winter and heats up in summer, and where different air masses collide: the cold ones coming from Canada and the warm ones coming from the Gulf of Mexico. The result is an unstable climate, with waves of bad weather alternating with clear and sunny days. The rains are abundant: in one year, more than 1,200 millimetres (47 inches) of rain fall. The wind blows frequently as well.
Here is the average precipitation.
Average precipitation - New York
New YorkJanFebMarAprMayJunJulAugSepOctNovDecYear
New YorkJFMAMJJASONDY
Prec. (mm)95801101151051101151151101101001001270
Prec. (in)3.73.14.34.54.14.34.54.54.34.33.93.950
Days109111211111010991011122

Winter, from December to February, is cold: the average temperature is just above freezing (0 °C or 32 °F), but cold spells, in which the temperature can drop to about -10/-15 °C (5/14 °F), are not rare. The wind chill can make the air feel colder than it actually is.
Snowfalls are frequent, and sometimes can be abundant, resulting in real snowstorms. On average, about 60 centimeters (15 inches) of snow fall annually. On other occasions, the wind can blow from the south, bringing some mild days, with highs around 12/15 °C (54/59 °F). There are also clear and sunny days, with cold nights, and daytime temperatures mild or in any case acceptable.

In spring, from March to May, the weather continues to be unstable: the first warm days alternate with the return of cold weather. In March it can snow, and sometimes this can still happen in early April. But already in April, sometimes the temperature can exceed 25 °C (77 °F). In May, the average temperature becomes pleasant, although there can still be cool days, or even a little cold and rainy, while the first heat waves can bring the temperature above 30 °C (86 °F). On sunny days, the first afternoon thunderstorms can erupt.

Summer, from June to August, is hot, especially in July and August. However, there are different situations also in this season: cool days, maybe rainy as well, with highs around 23/25 °C (73/77 °F), alternate with hot days, with highs around 28/30 °C (82/86 °F). Sometimes even heat waves occur, in which the temperature reaches 35/38 °C (95/100 °F), and remains high during the night, around 23/25 °C (73/77 °F) or above. The amount of sunshine during the summer is good, even though, in addition to the passage of some weather disturbances, there's no shortage of afternoon thunderstorms.

Autumn, from September to November, is milder and less unstable than the other seasons, at least in the first part. In early September, the weather is often still characterized by heat and humidity, with sunshine and some afternoon thunderstorms, then it quickly becomes mild and relatively quiet until mid-October, while in the second half of October the first cold days may occur. November is by now a cold month, and the first snowfalls may occur. There's no shortage of rainfall also in autumn, but it is still the season in which rainy days are a little less frequent.

The amount of sunshine in New York is good in summer, but it's not low even in winter, because as mentioned some sunny days can always occur. On average, there are 10 hours of sunshine per day in June and July, and 5 in December and January.

New York, 5th Avenue

For swimming, the sea in Long Beach is never very warm, however, it can be considered as warm enough for swimming in July and August, when its temperature reaches 22/23 °C (72/73 °F), while in winter it becomes definitely cold. Here are the average sea temperatures.
Sea temperature - New York
New YorkJanFebMarAprMayJunJulAugSepOctNovDec
New YorkJFMAMJJASOND
Sea (°C)75571117222320171310
Sea (°F)454141455263727368635550

When to go

The best times to visit New York are spring and autumn, to avoid both the winter cold and the summer heat, and in particular the month of May, and from mid-September to mid-October. June is often a good month as well, but sometimes it can be hot. In early September there can be a sticky heat, though not as intense as in midsummer. In April, it can sometimes be cold and the weather can be unstable, especially at the beginning of the month, while the second half of the month is usually mild.
In autumn (usually around late October), in the parks of the city you can admire the beautiful colours of the trees losing their leaves (the phenomenon called fall foliage).