This paper examines the importance of gender differences in labour supply and demand for job flexibility to the growth of the gender wage gap over the life cycle and over time for graduates in the UK. We document that the graduate gender wage gap increases over the life cycle, especially between ages 25 and 40, to about 20% of real hourly male earnings by age 55. The share of women working in flexible occupations has grown over the life cycle, and especially substantially over time for successive cohorts, whereas men are less likely to work in flexible occupations at older ages. The wage penalty from working in flexible occupations increases both over the life cycle and over time. We estimate a model of labour supply and demand to quantify the importance of changes to preferences and relative demand for flexibility on the gender wage gap. Higher relative demand for male labour at older ages, and in in flexible occupations, explains almost all (96%) of the estimated life cycle increases in the gender wage gap, whereas women's higher preferences for working in flexible occupations drives the increases in sorting into flexible occupations over time, contributing to about 60% of the estimated increase in the gender wage gap over time.