When the Romans invaded Ancient Egypt they came upon a new and unfamiliar way of keeping track of time. Julius Caesar was so impressed by it though that he decided to bring it back to Rome, connecting the calendar with the solar year and the European position of the Sun.
He tasked the mathematician Sosigenes to make an adaptation of the Roman calendar similar to the Egyptian, resulting in the creation of the Julian calendar.
But the Julian calendar made it very difficult to track Jewish and Christian religious holidays since they had to do with the lunar year and so they began seeking another solution.
A more accurate calendar, which accounted for church dogma, originally developed and presented by the Calabrian doctor Aloysius Lilius, was adopted in 1582.
The calendar was approved by Pope Gregory XIII, with the papal bull Inter gravissimas giving the world the Gregorian calendar, which got rid of leap days on years that met 2 key conditions - if the year is a multiple of 100 and not a multiple of 400.
From a mathematical standpoint, this means that the calendar repeats every 28 years for sure. But the calendar may repeat in shorter intervals of 5-6 years as well, depending on when the leap year occurs.
Whether a calendar repeats also depends on the adjustments done at the end of every century.
What we can say for sure is that the calendar of leap years repeats every 28 years within a single century, while for non-leap years it can repeat a lot more frequently.
Or in other words - the calendar for the year 2000 only repeats every 28 years until the year 2084, while the calendar for the year 2001 repeats 6 years later in 2007, as well as 17 years later in 2018 and of course - in 2028.