Fans have several ways of classifying these stories. The early stories, for example, tend to be classed as 'pure historicals', meaning that the only science fiction element is the Tardis and its crew. Stories of this kind became less frequent as the show developed. Indeed The Highlanders (1966) was the last such serial until Black Orchid in 1982. As far as I can recall, there have been none since.
There have, however, throughout the programme's long run, been many further historical stories. But these, known as 'pseudo-historicals', have included alien or sci-fi elements other than the Tardis crew. An example, set in the time of Rosa Parks, was broadcast recently.
This was also an example of another fannish sub-class: the 'celebrity historical'. This was a feature of many, though not all, of the earlier tales. The Highlanders, for instance, doesn't include a role for Bonnie Prince Charlie.
But over the years the Doctor and his/her companions have met Shakespeare, Elizabeth I, Dickens, Nero, etc., etc.
Who invented this kind of story? Plays and novels have often been based on real historical events. Many of Shakespeare's plays centre on actual lives and choices.
But it was probably Sir Walter Scott who wrote the first 'celebrity historicals', i.e. stories in which ordinary people have adventures at key moments of history, and in the course of events encounter the celebrity players. Queen Elizabeth has a walk-on part in Kenilworth, Richard the Lionheart in Ivanhoe, and of course the Young Pretender in Scott's debut novel Waverley: each episode offers moments of genuine frisson and readerly delight. But it is in Redgauntlet, which tells of a third, fictional Jacobite attempt, and is thus divorced from the demands of the historical record, that Scott delivers his greatest punch. Now the Chevalier has a complicated love life; he's older; and he's nowhere near so bonnie as he was in Waverley.
He was a man of middle life, about forty or upwards; but either care, or fatigue, or indulgence, had brought on the appearance of premature old age, and given to his fine features a cast of seriousness or even sadness. A noble countenance, however, still remained; and though his complexion was altered, and wrinkles stamped upon his brow in many a melancholy fold, still the lofty forehead, the full and well-opened eye, and the well-formed nose, showed how handsome in better days he must have been. He was tall, but lost the advantage of his height by stooping; and the cane which he wore always in his hand, and occasionally used, as well as his slow though majestic gait, seemed to intimate that his form and limbs felt already some touch of infirmity.Only later, some time later, does Scott confirm the identity of this man: 'It is needless to add,' says Scott, flattering the reader. Who was fooled? Did Scott suppose anyone would be?