Gregory was Pope in Rome beginning in 590 AD. That’s just after the arrival of the Lombards in Italy. He saw that with Western Europe now pretty much free from the control of the Roman Empire, there was room for the Pope to be more powerful than before. So he took this chance to make himself (and later Popes) more powerful.
Gregory came from an old Roman senatorial family. He had been the prefect of the city of Rome while he was still a young man. Then he decided he wanted to be a monk instead and entered a monastery, where he devoted himself to prayer and simple living. But the old Pope decided Gregory should be a leader of the Church instead. The Pope made Gregory leave his monastery and go to Constantinople as the Pope’s messenger. While he was in Constantinople, Gregory wrote an important book, a commentary on the Book of Job in the Bible, that laid out Christian ideas like Purgatory in simple ways that everyone could understand.
In 590, a terrible plague hit Rome, and the old Pope died. The bishops elected Gregory to be the new Pope. The Roman emperor agreed that he could be Pope. Gregory tried to extend the power of the Church all over the Western Mediterranean. It was during his reign that the Visigoths converted from Arianism to Catholicism.