Popes have changed their names to honor one of their predecessors or to take a Christian name if they were not born with one.
It is an unwritten custom which does not have to be followed. No pope is required to change his name anymore than someone who is about to be confirmed has to take a different name for the sacrament.
Traditionally, however, since most Catholics are baptized as infants, they have no choice in their first name (or baptismal name). When a person is confirmed, she can (and often does) choose another name for confirmation, usually taken from a saint whom she hopes to emulate and model her life upon.
Popes can keep their baptismal or birth name, as did Saint Peter (the first pope) and all the popes who followed through to Pope Boniface II (the fifty-fifth pope) who reigned from 530–532 AD. The fifty-sixth pope was the first pope to change his name. His given name was “Mercury” from a pagan Roman god, and upon becoming pope he took the name “John” and became Pope John II (rather than Pope Mercury). No one told him he had to do it. He merely did it of his own free will. The next ninety-plus popes retained their baptismal names until 1009 AD, when Sergius IV started the custom of every pope taking a new name, regardless of what his birth or baptismal name was.
The current pope, Pope Benedict XVI, was born Joseph Ratzinger; before him, John Paul II was born Karol Wojtyla; John Paul I was Albino Luciani; Paul VI was Giovanni Montini; John XXIII was Angelo Roncalli; Pius XII was Eugenio Pacelli.
There is no rule which prohibits any name, but custom and respect for the first pope has dissuaded bishops of Rome from taking the name Peter. There are superstitious rumors and private revelations which the Church has never endorsed nor approved that claim the last pope before the end of the world will take the name Peter (hence, he would be Pope Peter II).
Catholics must keep in mind, however, that if a newly elected pope were to take that name, it would necessarily not mean the end was near, since “we know not the day nor the hour.”