The election timelines provided for in the Constitution indicate that President Uhuru Kenyatta has 30 days in office, starting today.
But this will depend on whether the presidential poll produces an outright winner in the first round and the losers do not challenge the outcome in the Supreme Court.
Uhuru's stay in office could stretch into months should there be a run-off, coupled with presidential petitions and repeat presidential election, as the law demands that he only vacates office once the new one assumes office.
Article 138 (10) of the Constitution obligates the electoral commission to declare the final presidential results within seven days. With the poll planned for August 9, the commission has until Monday, August 16 to make the declaration.
If there is an outright winner on August 16 and the losers do not file a presidential petition in the Supreme Court, Article 141 provides that the president-elect should be sworn in on the first Tuesday following the 14th day after the commission has declared the results.
The 14th day after the declaration will be on August 30 and the president-elect will have to be sworn into office on September 6.
With the contest that appears to be too close to call between Azimio la Umoja One Kenya presidential candidate Raila Odinga and UDA's William Ruto, it is unlikely that there will be no legal challenge.
"Accepting the outcome of the poll includes going to court if I will have an issue with the results," said Ruto during the presidential debate and promised to accept the decision of the court whichever way it will go.
John Waiganjo, an advocate of the High Court, observed that in the prevailing circumstances, an outcome of the presidential race without a legal challenge is unforeseeable.
"The poll is too close to call and the possibility of an outcome without a legal challenge is a difficult one," said Waiganjo, who served as Ol Joro Orok MP in the 11th Parliament.
To be declared an outright winner in a presidential election, a candidate must get more than 50 per cent of all the votes cast and at least 25 per cent of the total votes cast in half of the 47 counties. If no candidate meets the threshold, the Constitution provides for a run-off, which should be conducted within 30 days of the declaration of results. The run-off will be contested by the top two candidates and the winner will be determined by a simple majority.
Since the presidential system was introduced in the 2010 Constitution, Kenya has never had a presidential election run-off.
Article 140 gives any Kenyan the right to challenge the outcome of the presidential election. Such a person has seven days to file a petition in the Supreme Court. The petition must be filed by August 23, which will be the final day and the court must deliver its verdict within 14 days, which will be September 6.
Should the Supreme Court uphold the conduct of the poll in its verdict, the new president will be sworn in on the seventh day after the court renders its decision. This will be on September 13.
Another simulation conducted by a consortium of constitutional lawyers early this year developed a grim scenario that shows that Uhuru could stay around until May 2023.
The simulation was anchored on the assumption that the president-elect will be sworn in after five months of legal battles characterised by three presidential petitions.
However, political analysts say that although the simulation is legally tenable, it is a political impossibility in a country that is reeling from tough economic times and endless political activity.