Popes can, and do resign, but no pope has done so since 1415 when Gregory XII was asked to do so to help end the split in the Catholic Church known as the Great Western Schism.
The most famous pope to resign was Celestine V and he was placed in hell in Dante’s Divine Comedy as a result. Celestine resigned in 1294 at the age of 80 overwhelmed by his duties, was imprisoned by his successor and died two years later.
Ten popes have resigned, some in the early centuries of Christianity, but most during the turbulent centuries at the end of the first millennium and the beginning of the second.
The subject of resignation was brought up on numerous occasion during the various illnesses of John Paul II and it is now known that he prepared two letters, in 1989 and then in 1994, offering his resignation in case of incurably illness or incapacity. John Paul II lived for another ten years after his last letter, dying just after Easter 2005.
Resignation is provided for under the 1917 code of canon law and under regulations established by Pope Paul VI in 1975 and by Pope John Paul II in 1996.