Number of immigrants in New York state: less than 4 million. Number of illegal aliens: more than 500,000
In November 2007, the Fiscal Policy Institute offered the report "Working for a Better Life/A Profile of Immigrants in the New York State Economy" (fiscalpolicy.org/immigration.html) which was co-produced with the New York Immigration Coalition.
Their full report says there are about four million "immigrants" in New York state, but they admit that they're including everyone who was born in a foreign country "whether or not they have become U.S. citizens and regardless of their legal status" in that figure. Thus, if we exclude those who are not immigrants but in fact are naturalized citizens, the number is probably a bit less. It should also be taken into account that the report was designed to promote profiting from massive immigration, so whereever possible they've probably "rounded upward".
Regarding illegal aliens, they say this:
Using the methodology he developed with his colleagues at the Pew Hispanic Center and Urban Institute, Jeffrey S. Passel developed as a contribution to Working for a Better Life a previously unpublished estimate of undocumented workers in New York City. According to Passel’s analysis of 2000 to 2006 data, there are 374,000 undocumented workers in New York City, making up 10 percent of the resident workforce Overall, Passel estimates that there are 535,000 undocumented immigrants in New York City, a figure that is broadly consistent with the New York City Department of City Planning estimate of about half a million.
They say that around 10% of that number could be those who are in the process of adjusting their status and so forth. However, considering that they've already got over a half a million illegal aliens in New York City alone, the number for the whole state is at the very least well over half a million.