The Doctor, the shape-shifting, dimension-hopping hero of “Doctor Who,” may have traveled the cosmos for centuries, but for the earthbound humans who have portrayed him, the job has lately lasted about three years. So it goes for Peter Capaldi, who came into the role on this long-running science-fiction series in 2014, and is now nearing the end of his journey. Mr. Capaldi, the Scottish actor (and star of the political satires “The Thick of It” and “In the Loop”), said in January that the current season, which begins Saturday on BBC America, will be his last.

There are still plenty of interplanetary adventures to come for Mr. Capaldi’s incarnation of the character, as well as the introduction of a new companion for the Doctor (played by Pearl Mackie), before he takes his final spin in the Tardis. Speaking by phone from London, where Mr. Capaldi was taking a break from filming “Doctor Who” in Cardiff, Wales, he talked about his decision to leave the role and what he’s learned from his time on the series. These are edited excerpts from that conversation.

What is it like, in the midst of shooting a “Doctor Who” season, to get a few days of shore leave in the real world?

I’m sort of institutionalized when I’m filming. People lead me from my trailer to the studio. People ask me if I want cups of coffee. They give me a ride home, they pick me up in the morning. They tell me what I’m going to be doing the next day. After 10 months of that, you’re like, “What crime did I ever commit to get into this really nice prison? [Laughs] It’s a bit of a shock every weekend when I go home, because my wife and my daughter do not treat me as if I’m the star of the show. I have to make my own coffee.