Not the longest, but one of the hottest!! We boarded a TWA B747 going from Frankfurt to JFK, when the announcement came that one of the tires had to be replaced. We sat for almost four hours in the airplane, with an outside temperature of around 30 C; since none of the engines were on, there was no AC or anything that could provide any relief from the hot air inside the airplane, not even the doors were opened. Since this was an international flight and everyone, including their luggage was checked and ready to go, nobody could leave the airplane, at least that was the official explanation. When we finally got to JFK, we lost, of course, our Gate and were eventually ferried by bus to the terminal. There I found out that my connecting flight was long gone, and I had to sleep the night @ terminal, which was no trouble because it gave me the oppertunity to explore JFK.
All in all, a great trip for an aviation enthusiast. The landing on a TWA B747 into runway 31L @ JFK is something I will never forget.
PS: I have seen a few Air India flights scheduled from New Dehli to Frankfurt making it almost 24 hours after ETA.