Metonic cycle
Nineteen years of 12 lunar months each would last a total of  lunar months. But from astronomy we know that 19 solar years are the same length as  lunar months. So over 19 years,  extra lunar months need to be added to make the years line up correctly. Adding a thirteenth month in a year is called intercalation. There are different ways to do it: