Since it's that time of century, I thought I would dig out of my memory four books I remember having read where the protagonist becomes Pope. I've lost my copies of them, if I ever had them, long ago.
Peter de Rosa, Pope Patrick. Written in 1995, set in 2009 after the death of John Paul II. This has got some quite good reviews, but I don't know why; I thought it was a load of rubbish. Irish country priest gets sort of accidentally elected Pope; outlaws banking (or at least banking with interest); bonds with the (Catholic) US president who defeated Sylvester Stallone in the 2008 election; eventually wiped out in a nuclear war with the Islamic world. Full of cod-Irishry.
Morris West, Shoes of the Fisherman. Written and set in 1963, the year of the death of John XXIII. Starts dramatically as a Ukrainian is elected pope without a ballot, the cardinals being suddenly inspired by the Holy Spirit. Nothing much then happens; the Church attempts to bridge the gap between the Soviet empire and the West, and somebody resembling Teilhard de Chardin gets into theological trouble. Made into a 1968 film with Anthony Quinn, Laurence Olivier, John Gielgud. Unlike the other three books I list here, the Pope lives on for two sequels, which I have not read.
Fr Rolfe (Baron Corvo), Hadrian the Seventh. Written and set in 1904. Total wish-fulfillment of the author, himself a failed priest; the Cardinals, unable to agree on the new Pope, come and beg him to take over; he duly does so, sorts out the entire world by allocating large chunks of it to the Germans to run more efficiently, and is, inevitably, assassinated. Horrendously right-wing, even I suspect for 1904, but more passionately written than the above two.
Walter F. Murphy, Vicar of Christ. I think I have listed these in reverse order of when I read them and this was the first. Written and set in 1979. The hero in this case is much more interesting, an American war hero who has served as Chief Justice of the Supreme Court and then abruptly retires to a monastery after his wife is killed in a car crash. Like de Rosa's book, set after the death of John Paul II (but in this case after a one-year rather than a thirty-year reign); like in Hadrian the Seventh, the cardinals are deadlocked and go for an outside candidate, ie our protagonist. He proceeds to reform the Church drastically (reforms that are all still needed) and is, of course, assassinated at the end.
All of these books veer from earnest to silly, and I haven't read any of them for around a decade. To be honest I think Murphy's Vicar of Christ is the only one I would seek out again.