"The 21st century is when everything changes."
Ex-Time Agent Captain Jack Harkness first met the Doctor and Rose during the London Blitz, where he is working as a con-man, trying to get the Agency to give back the two years of his memories that they stole. Often preceded by his charismatic reputation, the Doctor must constantly remonstrate him for flirting with virtually anything with a pulse.
Whilst on the Game Station, Jack was exterminated by the Daleks, only to be brought back to life by Rose after she absorbed the energies of the time vortex. Unable to control the power of the Bad Wolf, she immortalized him, and Jack was abandoned in the year 200,100, using his vortex manipulator to bounce through the timelines.
He was forced to wait for centuries until he reached 21st century Earth, where he became the leader of the Cardiff branch of Torchwood. There, he waited until he would encounter his old friend again, and his prayers were finally answered when the Doctor and Martha arrived in Cardiff to refuel the TARDIS on the Rift. Jack desperately clung to the outside of the spaceship as it hurtled through the vortex, and, and in an attempt to shake him off, it set its destination to the very end of the universe, where they encountered Professor Yana and the Futurekind.
When the Master was reborn and stole the TARDIS, the Doctor, Martha and Jack used Jack's vortex manipulator to follow him back to the 21st century, and, during the Year That Never Was, Jack worked as an engineer onboard the Valiant. He eventually managed to destroy the Master's Paradox Machine and after the world had been saved, he returned to Torchwood. Before he left, Jack unbeknowingly alluded that he was to become the Face of Boe, a giant head in a jar that the Doctor has encountered on various occasions throughout his travels.
The next time Jack sees the Doctor, it is to join forces with the Children of Time to bring down Davros and the Daleks. With the 27 planets restored, he returns to Torchwood alongside Martha and Mickey. Their next encounter is in an outer space bar, where the Doctor passes Jack a note advising him that the man sitting next to him is called Alonso. Jack starts up a conversation with him, seemingly the beginnings of a romantic bond between the two.