Yes you can, you have enough time. Just take the subway from JFK out to downtown NYC. Very quick and significantly cheaper than a cab. However, if cost isn't an issue there are cabs that give you a flat rate $40 one-way to downtown from JFK, tip not included of course.
Hope this helps.
Leaving the airport