I arrive JFK Terminal 8 from LHR at 17:05 and need to transfer to Terminal 5 for a 19:45 domestic flight. I have Global Entry and TSA Precheck and only carry-on baggage. Is this enough time to leave T8, take Airtrain, and get through security at T5?
If the plane is on time, this is doable with Global Entry, hopeless without. Upon landing, you might see a queue a mile long waiting for immigration and empty space next to it. This might be signposted for crew only or not at all but don't be disheartened, by the time you actually get to immigration (this can be a few minutes walk next to all the people who are queuing...) you will realize you are in the right place. I'd expect even 90 minutes can be enough but 2.5 hours is easy.
But let's get back to that if. This is a transatlantic flight, likely flown by a widebody plane (747 and up,A330 and up). The problem with those is if the plane has a problem, the airline won't have a spare. For short flights at a major hub, it's possible the airline has a single aisle small plane (737, A320, that sort) on standby but the widebodies are much more scarce. Admittedly, the East Coast is reachable from London with a narrowbody as well. Check what your flight is supposed to use.
I very often book unprotected connections: I fly from Vancouver to wherever I can get to Europe either on a sale or a low fuel surcharge award ticket, then sleep at or near the airport and continue the next day. I would not try same day connections, much less 2.5 hours. Not only are the chances high of not making it but if your plane say starts an hour late, you will spend the entire flight stressing out what happens on landing. Of course, if you are the unshakable, totally laid back, ice-in-their-veins kind of person, kudos for you and this doesn't apply. For a lot of people, I am afraid, this is a valid concern.