David Cameron’s six-year tenure as the U.K.’s prime minister will come to an end on Wednesday, when he formally hands the reins to Theresa May in the wake of Britons’ startling vote to leave the European Union. Brexit may go down as the defining point of Mr. Cameron's time at No. 10 Downing Street—as the leader of the campaign to remain it has ultimately cost him his job—but his premiership involved many triumphs and challenges. Here’s a quick look at Mr. Cameron’s leadership and how it may shape his legacy.