On July 23 2019, it was announced that Boris Johnson had been elected as the new Leader of the Conservative and Unionist Party. He will become Prime Minister on 24 July.
When will Boris Johnson cease to be Prime Minister of the United Kingdom?
This question will resolve as the date that Boris Johnson has left the position of Prime Minister of the United Kingdom, whether through resignation, a vote of no confidence, loss of Parliamentary seat, incapacity, death, or any other reason.
Note that this does not automatically resolve in the event that a general election is called. Although there are no MPs after Parliament is dissolved, there is by convention still a Prime Minister, and ministers continue to hold their offices despite not being MPs.