A year is a leap year if it divisible by 4, unless it is also divisible by a 100 in which case it is not, unless it is also divisible by 400 in which case it is. This results in an average of 365.2422 days per year, which is pretty close to the actual of 365.242199.
Currently the Gregorian Calendar loses about one day every 3200 years. Some future pope may have to declare that years divisible by 3200 are not leap years. The Gregorian calendar reform was instituted to keep the calendar aligned with the seasons from about 325 AD, the year of the Nicene Counsel, which set the date of observance of Christmas on the Julian Calendar.
A leap day every 400 years is .0025 of a day, not .0022 , so the Gregorian calendar is 365.2425 days long.