In the classic series, the occasions when different incarnations of the Doctor encountered each other all resulted from the intervention of the Time Lords. They could and several times did remove things from people's memories. It's likely (but not certain) that the Time Lords removed the memories in order to protect the timeline.

In the revived series, when the Time Lords are no longer around to intervene, there has so far been only one encounter between different incarnations of the Doctor. That was in "Time Crash" and he did remember at least some of that—although he had also at least partly blocked it out—as was explained in the story itself. But there have been multiple instances where the Doctor met (e.g., "Time") or otherwise gained knowledge about (e.g., the entire 'Doctor's death' plot from series 6) his future self from the same incarnation, and his future self generally does clearly remember the encounter from the first time. And in fact, the same is true for his human companions (e.g., "Time" again). This seems to support the idea that his earlier "amnesia" about encounters between different incarnations was (at least largely) caused by the Time Lords.