Why years have different numbers of days
A solar year — the time Earth takes to complete one orbit around the Sun — is approximately 365.2422 days. Because a calendar year must contain a whole number of days, the Gregorian calendar alternates between 365-day common years and 366-day leap years. The extra day, 29 February, is inserted every 4 years, with century-year exceptions, to keep the average calendar year close to the solar year.
A common year has 52 full weeks plus 1 extra day (365 = 52 × 7 + 1), which means the day of the week on which a year starts is one day later than the previous year's start day. A leap year has 52 full weeks plus 2 extra days (366 = 52 × 7 + 2), shifting the following year's start day by 2.
Days in year = 366 if leap year, else 365
Leap year rule: divisible by 4, except centuries not divisible by 400.
Weeks in year = 52 (plus 1 or 2 extra days)
Every year has 52 complete weeks; the remainder is 1 (common) or 2 (leap) days.