Pope Gregory XIII decreed a change to the Gregorian calendar on February 24, 1582. It was not an innovation, but an upgrade of the Julian calendar. Its purpose was to return the Catholic Easter to the date when it the earliest Christians were believed to have celebrated it and to keep the days of the calendar year in better alignment with the position of the earth in its path around the sun.
Pope Gregory XIII and Aloisius Lilius
Pope Gregory XIII was a great manager. He led a blameless personal life as pontiff, reformed the structure of the church, and implemented the recommendations of the Council of Trent. Yet he is most remembered for his reform of the calendar.
The Gregorian calendar was drawn up by Aloisius Lilius. (There is dispute about his name and biography.) He was a medical doctor and lecturer in medicine as well as an astronomer and chronologist. His brother presented the new calendar to the church six years after Lilius' death. It aligned the months of the Julian calendar more closely with the seasons.
Dr. Lilius knew that he needed a calendar that averaged about 365.242 days to match the time the earth actually took to go around the sun. Then he needed a simple and memorable way to add leap days, in order to keep the calendar aligned with the seasons.
Adding a day every four years as the Julian calendar had made the calendar slightly too long. Therefore, the Gregorian calendar added leap days every four years, but omitted them on three out of four years ending in 00. A year divisible by four is a leap year, except if it is also divisible by 100, but years divisible by 400 are also leap years. Therefore1996 is a leap year because it is divisible by four, 2000 is a leap year because it is divisible by 400, but 1900 is not a leap year because it is not divisible by 400.
The Julian calendar
The Julian calendar was a refinement of the old Roman calendar. Julius Caesar introduced it, and gave it his name. The Julian year was 365 days long, with a leap year every four years for an average year of 365.25 days. This kept the calendar better aligned with the sun than the old calendar had, but it still drifted, because it was longer than the actual, or "tropical" year. The Julian calendar was about 11 minutes a year too long, which made Easter 11 minutes earlier each year. It diverged by a day about every 131 years.
Tropic and Calendar Years
A tropical year is the time it takes for the sun to get back to the same position in the heavens as it held last year. Put another way, a tropical year is the time from summer solstice to summer solstice, for example, or from vernal equinox to vernal equinox. The tropic year varies, but the mean is about 365.242 days. There are other ways to look at the length of an earth year, but the tropic year is one useful way.
Calendar years according to the Gregorian calendar are an average of 365 days 5 hours 49 minutes and 12 seconds or about 365.2425 days long.
When the Gregorian calendar was instituted in 1582, the day after October 4 became October 15. It must have been much more jarring than spring forward/fall back, though few immediately followed it: ten lost days. This returned Easter to its former place in the calendar.
The Roman Catholic Easter now falls on the first Sunday after the first full moon after the vernal equinox. It is still a moveable feast, but now within narrower limits than before the reform.
Pope Gregory's calendar is now used worldwide, though many cultures do not use the BC/AD (Before Christ /Anno Domini) numbering system based on Catholic tradition. The calendar is a close approximation, which should serve well for the next thousand years or so.