I travel to New York City (Manhattan) and I would know some good spot to take photo of sunset and sunrise in New York.
Since most visitors come to New York City and refer to it as New York, I will base my answers on the assumption you mean New York City (we can be pedantic around here :) ).
Manhattan Island runs lengthwise essentially Northeast to Southwest, such that if one were standing in Midtown (say Times Square), sunrise would occur roughly east of Central Park looking towards Central Park (northeast or uptown). Likewise, sunset would occur in westerly in the direction of New Jersey, when looking downtown or southwesterly. This can be difficult to describe, so check out this online tool: Suncalc.
Given this, a few recommendations central to Manhattan:
Central Park, essentially anywhere, but uptown (103th st). Sunrise can be blocked early by the highrises of Central Park East and Midtown, so for an even better view:
Hoboken NJ: Take the Subway to the World Trade connection, get on the PATH train to Hoboken. A short walk to the waterfront where you can take shots of the sunrise over the skyline of NYC.
Battery Park: this is a park on the 'tip' of Manhattan, overlooking the harbor. It also provides an incredible view of the sunsetting to the west,including the Statue of Liberty in the shot.
Circle Line Cruise: If you want a closer view of the Statue, you can get on a Circle Line Sunset cruise that will take you in the harbor and around the island.
Top of the Rock: This is 30 Rockefeller, the NBC Building in Midtown. There is an observation deck on top. Get a time around sunset and you can get a shot of the sun setting over Manhattan. You can also get a Sunset ticket, which gives you and entrance during the day, and one in the the evening.