This list of Prime Ministers of the United Kingdom lists each Prime Minister in order of term length. This is based on the difference between dates; if counted by number of calendar days all the figures would be one greater.
Of the 54 Prime Ministers, 9 served more than 10 years while 7 served less than 1 year.
Robert Walpole is the only person to have served as Prime Minister for more than 20 years. George Canning served as Prime Minister for less than four months before his death.