The Chinese lunisolar calendar tracks two things at once: months follow the moon, years follow the sun. A synodic month runs about 29.53 days, so 12 lunar months total roughly 354 days — while the solar year is about 365.24 days. The gap is around 11 days a year. Left alone, the lunar new year would drift into summer within three decades, and festivals would detach from the seasons entirely. The leap month exists to close that gap.
The rule compresses into one line: seven leap months every 19 years, assigned where no major solar term falls. The calendar splits its 24 solar terms into two alternating groups, and every lunar month is supposed to contain one "major term" (中气). When a year carries 13 months and one of them contains no major term at all, that month becomes the leap month — named after the month it follows, as "leap second month," "leap sixth month," and so on.
Why 19 years? Because 19 solar years and 235 lunations differ by only about two hours, so inserting seven leap months in that span realigns lunar dates with the seasons. Astronomers call it the Metonic cycle; Chinese calendar scholars derived the same structure independently as the "chapter" system (章法).
No need to memorize rules. Enter a Gregorian year into a lunar calendar converter and the result labels the leap month directly — 2023 had a leap second month, 2025 a leap sixth month, 2028 a leap fifth month. Converting dates both ways and looking up the lunar date for any day live in the same tool.