There was an episode where the Doctor met up with someone who thought they were the Doctor. What was it?
Although the era of this episode isn't clear based on your question, my guess is that you are referring to "The Next Doctor", one of the later Christmas specials from the Tenth Doctor run.
The character that you are referring to, who thinks he is the Doctor, is
Jackson Lake, played by David Morrissey. He encounters Cybermen in 1850s London, where they kill his wife. The trauma from her death, combined with an infostamp featuring information about the Doctor, results in him believing he is the Doctor. Eventually, after coming into contact with the real Doctor, he regains his memory.
Presuming that this was a Christmas special, set in a Charles Dickens 1880-ish setting, it was probably "The Next Doctor" -- in which a human had gotten infused with The Doctor's memories, so thought he was The Doctor, and was fighting an alien invasion that culminated in a steam-powered walking robot a hundred or so feet tall.