I know that the doctor couldn't leave the planet because all the aliens would destroy it as soon as he was gone. I know that he had to stay on or near the planet so that he could say the name if it was ever threatened to be blown up. That means that the aliens have to come after him in small raids to try and kill him. But why didn't he just to go another ship or a different, uninhabited part of the planet? That way he wouldn't risk the townspeople's lives by having a battle rage around them. Or did he have to be within a certain distance of the crack for the time lords to hear him?
It is implied that proximity to the Crack was necessary for the answer to be heard.
Though it wasn't outright stated, the presence of the truth field implies that answers have to be pretty close to the Crack in order to be heard. I suspect the Doctor was bluffing when he claimed to be able to summon the Time Lords from aboard the Mainframe ship.
Beyond that however, only by being immediately nearby could the Doctor know in time if something was happening to Christmas which would warrant his needing to say his name. If he was too far off, he couldn't be sure of responding quickly enough--time machine or no.
Well there's a few points as to why this is the case...
The truth field was as the first villagers whom The Doctor encountered had said, "It was stronger the closer you were to the Tower."
- This means that he had to be close to the crack to be able to communicate with them.
- He could not just leave the planet because it was shielded by the Papal Mainframe.
- If he had somehow been on another ship or uninhabited location, then the armies that wanted to stop The Doctor would not waste time looking for him... They would simply attack Christmas in hopes that The Doctor would come to defend them, the best spot for him was to defend the town instead of let people die by simply hiding.
- His best chance of defending the town against everyone would always have been to stick close to the town in case anybody decided to try a large scale attack, by bluffing that he would reveal his name so The Time Lords would come through. Which is why it took over the many centuries for the forces to try small scale invasions and then eventually wait out until he was old and frail in hopes that they could easily defeat him because they were afraid of The Time Lords and the subsequent new Time War.