The 184th-ranked Evans, once the British number one, beat world number 22 Khachanov in five hours and 35 minutes, exceeding the previous record of 5:26, when Sweden's Stefan Edberg beat American Michael Chang in the 1992 semi-final.
Evans put up 14 aces across the gruelling affair that dragged on so long the Briton said he had to look at the monitor at one point to remember what set he was in.
"When you're a kid, you're just told to fight until the end. I mean, that's sort of rule one," said Evans.
"I've done that pretty consistently for my career. It sort of paid off a bit today."
Court 6 rarely draws much of a crowd at the sprawling Billie Jean King National Tennis Center but droves of fans had assembled by the time the match crossed the five-hour mark, overwhelming the stands despite the sweltering conditions.
It looked as though Khachanov had the Briton on the ropes when he went 4-0 up in the final set, but Evans found a bit of fight left in him to fend off four break points in the fifth game before converting a break point chance in the sixth.
Fans jumped to their feet as Evans fended off another break point in the seventh game and broke into thunderous applause as Khachanov dropped his serve in the eighth.
The Russian shouted with frustration as he let another break point chance slip through his fingers in the ninth but the 2022 semi-finalist refused to go down without a fight as he saved two match points in the final game.
Evans braced himself on the net in apparent exhaustion briefly after sending over an unreturnable forehand to win a 22-shot rally on the final point, setting up a meeting with Argentine Mariano Navone.
The 34-year-old Briton has made it as far as the fourth round in Flushing but tumbled down the rankings this year as he struggled to find his best form and said the win on Tuesday was an obvious boost.
Evans said he was "immensely proud" after the match.
"I think that's the overriding feeling more than anything," he told reporters.
"I've had a lot of first rounds this year. It's nice to win a match."
--Reuters--