Not all restaurants let you book online. It really depends what restaurant. For some it is not even an option. However, a LOT of restaurants use OpenTable.com which powers not only their entire system but also makes it accessible to people 24/7 via the web.
Restaurants in NYC take reservations usually 31, 30, 28, days in advance or similar. Sometimes restaurants take them by phone 28 days in advance but ALSO limit OpenTable to 27 days in advance. So the OT limit might be different from the phone limit. People who call get first dibs, then it opens up to the web.
Additionally, some restaurants put very very few tables on OpenTable. Others put more but not their entire inventory of tables, choosing to leave some for VIPs, people calling, etc. So if a place looked entirely booked via OpenTable, you should ALWAYS call to see if there is additionally availability that is NOT available online.
It's not a perfect tool but extremely helpful if you're not dead set on the MOST popular places.