If you're writing a period piece, you have to really put your characters in their time frame. You have to know about the music, books and politics of the day. And you might be writing a story that takes place hundreds of years before anyone you know was ever born. So under those circumstances, is it all right to use historical figures in your fiction?
Anything ever written by Jane Austen can be purchased for free by you today. Any publishing company can print out copies of Jane Austen books, and they don't have to pay anybody any royalties for what they sell. It's because Jane Austen has been dead for so long that all her copyrights have now expired. Anyone can publish and use her books for free these days.
So what's the expiration date on a personality? If Jane Austen's copyrights are expired, does that mean that I can make her a character in my newest book?
The short answer to this is yes. If Abraham Lincoln, Vampire Hunter taught us anything, it's that historical figures are pretty much fair game in fiction. I can't even count all the romance novels I've seen featuring William I or Charles I as supporting or peripheral characters. They were both sort of larger-than-life personalities, so it makes sense to use them for color in a novel that's set in the right time period.
But that's the short answer. When it comes to actually using historical figures as characters in your novel, the answer is really much more multi-layered. Even long-dead historical figures have fans, people who have studied their lives. Some expert may devote into careers into the study of certain historical figures -- the House of Tudor, for example, in England. So if you're going to do it, you must do it well.
Research thoroughly to be sure you know a reasonable amount about this character. In order to realistically include them in a story, you ought to know what they look like. Knowing something about their personality can't hurt, either. Throw in any interesting facts you can find, things that humanize characters (Charles I and his dogs, for example).
If you plan on rewriting or changing history and still including historical figures, it gets trickier still. You may get some criticism for that. But if you've got a story idea and you think it's good and you're compelled to write, this is what you must do. When you're including a real-life person in your books, try to adhere to at least one rule: be respectful. Do this, and in most cases you'll probably be okay.