It started with Pope John II (533-35), whose given name was Mercury (he was a convert). As it was not a fit name for a Pope he took John. Subsequent popes have followed his example of changing their name.