She will star in a new series of the programme later this year before exiting the show in a trio of specials next year.
The first special will air on New Year's Day 2022, the second will be later in the spring and the third, when the Doctor will regenerate, will air in autumn 2022 and will form part of the BBC s centenary celebrations.
Leaving next year along with Whittaker – who described the role as the best job she has ever had – is showrunner Chris Chibnall
She said: "In 2017 I opened my glorious gift box of size 13 shoes.
"I could not have guessed the brilliant adventures, worlds and wonders I was to see in them.
"My heart is so full of love for this show, for the team who make it, for the fans who watch it and for what it has brought to my life.
"And I cannot thank Chris enough for entrusting me with his incredible stories.
"We knew that we wanted to ride this wave side by side, and pass on the baton together.
"So here we are, weeks away from wrapping on the best job I have ever had.”
Chibnall, who also joined the programme in 2017 and cast Whittaker in her role, will quit at the same time.
Whittaker follows in the footsteps of predecessors including Matt Smith and Peter Capaldi by stepping down after three series at the helm of the Tardis.
Chibnall said: "Jodie and I made a 'three series and out' pact with each other at the start of this once-in-a-lifetime blast.
"So now our shift is done, we're handing back the Tardis keys.
"Jodie's magnificent, iconic Doctor has exceeded all our high expectations.
"She's been the gold standard leading actor, shouldering the responsibility of being the first female Doctor with style, strength, warmth, generosity and humour."
Whittaker said being named the new Doctor felt "completely overwhelming, as a feminist, as a woman, as an actor, as a human, as someone who wants to continually push themselves and challenge themselves, and not be boxed in by what you're told you can and can't be".
She made history during the 2017 Christmas special when Capaldi's version of the beloved character regenerated and she became the first female to fill the role since the show began more than five decades previously.
Her first full episode as the Doctor, which aired in 2018, was aptly titled The Woman Who Fell To Earth and drew the programme's biggest launch viewing figures in 10 years.
Piers Wenger, director of BBC drama, said: "Over the last four years Chris and Jodie have made Doctor Who history and their time on the show is indelibly marked on our memories.
"From Rosa Parks to Ascension Of The Cybermen, Chris and Jodie have given Doctor Who some of its most life-affirming and tear-jerking moments to date, and we are beyond excited to see what they have in store for us in the new series this autumn.
"Jodie's final adventure to mark the BBC's centenary in 2022 is set to be a Doctor Who special to remember.”