Time-tripping mutant Hiro from Heroes is hardly the first guy to get some trans-temporal love action. But if you want the best-ever time travel sex story, you've got to go back to 1973, when David Gerrold (author of the famous "Trouble with Tribbles" Star Trek episode) published The Man Who Folded Himself. A Nebula winner, this short novel explores what happens when a guy inherits a big belt that lets him travel through time, play the stock market to get rich, and build himself a giant mansion where all his alternate timeline selves get together and have giant orgies.
You think I'm kidding, but I'm not. The entire point of The Man Who Folded Himself is to fly right in the face of typical time-travel logic, which says you're never supposed to meet yourself, let alone get busy. Maybe it was the influence of the 1970s Me-Generation that made Gerrold decide to turn time travel into a fleshpot of egotism. No matter what the reason, he manages to write one of the most compelling, daring, and funny stories about time travel I've ever read.
Though it begins as a sex romp, The Man Who Folded Himself winds up being a meditation on trying to find yourself when there are so many possible selves you could have. At one point, the main character Dan travels so far outside his own time-frame that he meets the female version of himself and tries to make a life with her in a primeval world at the edge of history. There are never any anxious questions raised about why the only people Dan wants to be involved with are versions of himself, and that allows Gerrold to take us on a strange ride indeed. Definitely worth checking out, especially with the movie version of Gerrold's memoir about being a gay dad, The Martian Child, soon to hit theaters.