It's an interesting subject as while scripts and paperwork in the early years referred to him as "Dr Who" on screen he was just "The Doctor".
Where and how he appointed himself as "The Doctor" has never been specified, though Steven Moffatt did touch on it being his "promise" to the Universe, to be its 'Doctor', not a warrior.
When he first steps into that junk yard in his very first appearance Ian and Barbara only know him by the details he used to enlist Susan into their school. So they refer to him as a Doctor. He seems accepting of this and the name sticks throughout his time with Ian and Barbara, and well beyond. Because the turnover of companions was organic and one gave way to another each new companion just picked up on the name others referred to his as - "Doctor", and it can be argued that because of that continual use from those he travelled with this name is what he adopted.
But on the other hand, as his very first appearance implied, he may have already appointed it as his name before he met Ian and Barbara. What's really interesting to think on is that Susan surely must have been well aware of his *real* name, as well as his past. But she never even hints at it once Ian and Barbara join then in the Tardis. She protects his secrets as determinedly as he protects them himself.
Two fugitives on the run from some unseen power.
Any truth to rumour that the name that they wanted to use as his real and true name was to have been disclosed as being "God"