Let X be a compact Riemann surface of genus g >= 2, and let Aut(X) be its group of automorphisms. We show that the exponent of Aut(X) is bounded by 42(g-1). We also determine explicitly the infinitely many values of g for which this bound is reached and the corresponding groups. Finally, we discuss related questions for subgroups G of Aut(X) that are subject to additional conditions, for example being solvable