So from what I've learned the gregorian calendar was introdused in the 16th century by some pope, but how did they determine that Jesus was born x years ago?
There actually isn't any such thing as a year 0 -- the BC/AD calendar goes from 1-1. But that said, you may be interested in this section of our FAQ, particularly this answer:
How confident are we that the year is actually and exactly 2016? Is it possible that at some point in the last 2000 years there were any significant timekeeping mistakes? by u/sunagainstgold