The President of Earth, or President of the World was a title held by one person at a time, under special circumstances during the 21st century, on regular basis by at least the 26th century, continuing on at least into the 41st.
The position of Earth president originated in the early 21st century, before the establishment of a unified Earth government. Organised by UNIT, an international agreement was made on incursion protocols. Under this agreement, in the event of a full-scale invasion, a President of Earth with complete authority over every nation state was immediately inducted. It was decided the only practical candidate for this role was the Doctor. As Earth president, the Doctor would essentially be the Chief Executive Officer of the human race and the Commander-in-Chief of every army on Earth, under whom all world leaders would await instructions.
This induction was performed during an invasion of Earth by an army of Cybermen converted from the dead by Missy. Having stumbled upon the invasion, the Twelfth Doctor was captured by UNIT and taken aboard their presidential aircraft, Boat One, where he was inducted as Earth president. (TV: Death in Heaven) The Doctor was again inducted in the face of the Hyperion invasion in summer 2015. (COMIC: The Hyperion Empire) The Doctor continued referring to himself as the President of the World after these events, though Bonnie noted he did not like it. He also made use again of the presidential aircraft, but purely for "poncing about in". (TV: The Zygon Invasion)
Both Earth and the broader Earth Empire, and later the Earth Alliance were ruled by this elected figure. However, at least some of the later human empires were instead headed by emperors. (TV: Frontier in Space, Nightmare in Silver)
He or she did not, however, have full control over every aspect of the Empire. In purely military matters, the president was unable to overrule the head of the military without the backing of the Earth Senate. Also, the President of Earth had limited control over the affairs of the dominion planets such as Sirius IV: dominions were semi-autonomous and the president had no control over their domestic affairs. (TV: Frontier in Space)
The president led a democracy, and had to submit to periodic election cycles in which various candidates argued their positions in order to win popular approval. Earth Security was a shadowy police organisation which could hold troublemakers without trial. In extreme cases, the president had the power to remove political rivals to the Lunar Penal Colony for the rest of their lives. The position thus had elements of democracy and dictatorship about it. (PROSE: Doctor Who and the Space War)
In the early 21st century, the Twelfth Doctor was temporarily appointed President of Earth during the invasion of Cybermen. (TV: Death in Heaven) He was made president again during a Hyperion invasion, (COMIC: The Hyperion Empire) and a Zygon uprising. (TV: The Zygon Invasion) When the Monks appeared in a potential warzone, the Doctor was made President of Earth once more to deal with the threat. However, after being given a vision of a world-ending catastrophe, the world leaders stopped listening to him. As he saved the world, the Doctor commented to Bill Potts "President of Earth indeed." (TV: The Pyramid at the End of the World)
In 2540, President Dora came under great pressure to declare war on the Draconians, especially from General John Williams, but was able to maintain peace thanks to the Third Doctor. (TV: Frontier in Space)
Earth's Presidency was based in the White House in Washington DC during the Orion War of the early 26th century, when Duncan Levinson was President of Earth. (AUDIO: Scorpius) Upon Levinson's death, Karen Brett took Presidential office. (AUDIO: Fear)
By the 40th century, the government of Earth was instead headed by a Guardian of the Solar System. (TV: The Daleks' Master Plan) However, 41 years after Mavic Chen's demise in 4000, the title of Earth's head of state was again President of Earth. In the year 4041, the current President was still based in the Oval Office of the White House, where he was secretly under the control of the Klytode until the Tenth Doctor freed him. (COMIC: Return of the Klytode)