Most adolescents exhibit very late chronotypes and attend school early in the morning, a misalignment that can affect their health and psychological well-being. Here we examine how the interaction between the chronotype and school timing of an individual influences academic performance, studying a unique sample of 753 Argentinian students who were randomly assigned to start school in the morning (07:45), afternoon (12:40) or evening (17:20). Although chronotypes tend to align partially with class time, this effect is insufficient to fully account for the differences with school start time. We show that (1) for morning-attending students, early chronotypes perform better than late chronotypes in all school subjects, an effect that is largest for maths; (2) this effect vanishes for students who attend school in the afternoon; and (3) late chronotypes benefit from evening classes. Together, these results demonstrate that academic performance is improved when school times are better aligned with the biological rhythms of adolescents.