In The Witcher 3: Wild Hunt, during the main quest Bald Mountain, Geralt remarks that he remembers one of the enemy generals from his time in the Hunt. When was Geralt in the Wild Hunt?
Between the end of The Lady of the Lake (the last book) and the beginning of The Witcher (the first game)
In the book,
Geralt dies, and Ciri transports to an island in another world along with Yennefer - implication is that they lived there happily ever after.
However, it is revealed in The Witcher 2: Assassins of Kings that (in game canon) the Wild Hunt raided that island and abducted Yennefer to draw Ciri out. Ciri didn't bite it - but Geralt did. Along with Leto (yes, the baddie from Witcher 2) and two other folks from the School of the Viper they killed a whole bunch of the Riders of the Wild Hunt, but there were simply too many. When they got to the boss of the Wild Hunt, Geralt struck a deal with Eredin, offering his soul in place of Yennefer's.
Afterwards, Leto and his comrades take care of Yennefer, but they somehow end up in Nilfgaard (I'm fuzzy on the details right now, but Leto explains it in the game). This makes sense, sinse in the second game
Leto ultimately serves the emperor of Nilfgaard, slaying kings and paving a road for the former's new contest
and Yennefer greets us in Witcher 3
with an escort of Nilfgaardian soldiers.
Exact chronology is unknown, but long story short, Ciri freed Geralt from the Wild Hunt and dropped him somewhere near Kaer Morhen - and this is where the first game starts!
There's an animation recap from flashbacks in Witcher 2 which sums this up: