British Prime Minister Keir Starmer has announced he will resign after mounting pressure from within his own governing party.