Same earth. Different point in time.
Straight-forward 'historicals' - stories that are set in the past, have no science fiction elements other than the presence of the Tardis, and that are to some extent meant to be educational:
Genre spoofs - stories that are in a genre that happens to be set in the past, rather than about actual history:
(That's a bit of a stretch, really. 'The gunfighters' is an actual genre spoof, and the only thing setting it apart from the Robert Holmes genre bender is that there's no science fiction story lurking underneath. 'Black orchid' is a late 19th century gothic horror melodrama in an early 20th century setting that just happens to have the Tardis crew in it.)
Stories where time travel is part of the plot:
Alternate futures:
To boldly go where no man has gone before.
They're here...
Science and technology gone wrong.
What if...
To me, these stories seem primarily idea-driven rather than plot-driven (though I realise this is a judgement call). Some appear to be one genre, but are actually something else; others provide alternative explanations for real historical events. The various writers who have worked on Doctor Who have come up with different versions of this general idea.
The Robert Holmes genre bender, a genre piece (usually a gothic horror tale) with a science-fiction story lurking underneath:
The Douglas Adams genre bender and history twister, a heist story which turns out to be a science fiction story, which, in turn, provides an alternative explanation for the existence of life on earth:
The Eric Saward history twister. A science-fiction story that provides an alternative explanation for a historical event:
Fan fun.