Note that all passengers will go through immigration in JFK. You’ll pick up your bags, go through customs, and then drop them off at the transit desk at the other end of customs. At that point you’ve formally entered the USA.
From there, you can leave the airport as long as you get back on time for your next flight. Having global entry may give you TSA Precheck which will expedite your re-entry for your departure flight.
I would give yourself (there's a bit of buffer time included in these examples):
• 1.5 hours from landing to clear customs and immigration and get to
the airport exit
• 1.5 hours to get from JFK to downtown Manhattan, either via
train or taxi
• 1.5 hours to get back from downtown Manhattan
• 1 hour from JFK curbside to get back to your departure gate
Total = 5.5 hours - which gives you about 2 hours of sightseeing downtown
Note: If your domestic flight is on a Precheck participating airline and you entered your Pre number in your passenger data but your domestic boarding pass doesn't have the TSA Pre logo on it (because you had it printed in the UK), you might ask at the transit desk if they can re-print your domestic boarding pass so that it shows Pre-check. That'll speed your re-entry but it might not always be possible. @Berwyn has the excellent suggestion of seeing if your mobile boarding pass for the domestic flight has the TSA Pre check symbol on it, which would save you the time to reprint it.