The Julian calendar, introduced by Julius Caesar in 45 BC, defined a year as exactly 365.25 days by adding a leap day every 4 years. The actual solar year (tropical year) is 365.2422 days — about 11 minutes shorter. That 11-minute difference accumulated over centuries: by 1582, the Julian calendar was 10 days ahead of the actual solar calendar, meaning the spring equinox (March 21 in the calendar) was actually happening on March 11 in astronomical reality.
Pope Gregory XIII reformed the calendar in 1582, dropping 10 days (October 4 was followed by October 15) and introducing a refined leap year rule: a year is a leap year if divisible by 4, except for century years, which must be divisible by 400. So 1900 was not a leap year (divisible by 100 but not 400) but 2000 was (divisible by 400). This makes the Gregorian average year 365.2425 days, accurate to within 26 seconds of the solar year.
The adoption wasn't immediate
Catholic countries adopted the Gregorian calendar in 1582, but Protestant and Orthodox countries resisted for decades or centuries. Britain and its colonies (including what would become the United States) switched in 1752, dropping 11 days (by then the accumulated difference). Russia didn't switch until 1918, after the October Revolution — which is why the Russian October Revolution actually occurred in November by the Gregorian calendar.
Greece was the last country to switch, in 1923. Orthodox Christian churches largely still use the Julian calendar for calculating Easter and religious holidays, which is why Orthodox Easter falls on a different date than Western Easter in most years.
Historical date ambiguity: Old Style and New Style
Historians use the notation 'O.S.' (Old Style, Julian) and 'N.S.' (New Style, Gregorian) to disambiguate dates from the transition period. George Washington was born on February 11, 1731 (O.S.) — which is February 22, 1732 (N.S.) because Britain hadn't yet adopted the Gregorian calendar and also began the new year on March 25 rather than January 1. Washington himself celebrated his birthday on February 22 after the switch.
When calculating age differences or time spans that cross the calendar reform date, care is needed. Most date calculation tools and databases assume all dates are Gregorian (proleptic Gregorian calendar extended backward before 1582), which is the ISO 8601 standard. This can produce technically incorrect results for historical dates that were originally recorded in the Julian calendar.