In the later Roman Empire and the Middle Ages, the Pope was the leader of the Catholic Church. Whenever there was a question about whether God would like something or not, people could ask the Pope, and he would tell them what God wanted.
According to Catholic traditions (but there isn't any evidence from that time, even from the Bible), Jesus told his disciple Peter to lead the Church after the Crucifixion, and so Peter was the first Pope, and all the other Popes get their power from Jesus through him. Pope means "father", as the Pope is the father of the Church family.
Peter and Paul (mosaic from Ravenna, 500s AD)
In the earliest times where we do have any evidence (about 200 AD), the Pope was just the bishop of Rome, like any other bishop in other towns. But because Rome was the capital of the Roman Empire, the bishop of Rome seemed more important than the other bishops. Bishops from smaller towns came and asked his advice about things. When a lot of bishops needed to meet and have a council, they would meet in Rome, where there were good roads, and big basilicas to meet in. Like other bishops, the Pope was chosen by a council of bishops from among the powerful men of the city, and once he had been chosen he would stay the Pope for the rest of his life.