You can check in online at 24 hours prior to departure, as long as the passport information is accepted. If you are forced to check in at the counter, IIRC, I believe the limitation is 3 hours. Your luggage will be accepted at the counter at the 3 hour mark, as well, IIRC.
ETA - you may be able to use these as an alternative, for a fee:
http://www.jfk-airport.net/luggage-storage.html (not an official airport page, I cannot ascertain validity of the information provided)