When school-age children work, their education competes for their time and effort, which may lead to lower educational attainment and academic achievement. This paper develops and estimates a model of student achievement in Mexico, in which students make decisions on school enrolment, study effort and labor supply, taking into account locally available schooling options and wages. All of these decisions can affect their academic achievement, which is modelled using a value-added framework. The model is a random utility model over discrete school-work alternatives, where study effort is determined as the outcome of an optimization problem under each of these alternatives. The model is estimated using a large administrative test score database on Mexican 6th grade students combined with survey data on students, parents and schools, geocode data on school locations, and wage data from the Mexican census. The empirical results show that if students were prohibited from working while in school, the national dropout rate would increase by approximately 20%, while achievement would increase. Expanding the conditional cash transfer, either in terms of the magnitude of the cash benefits or the coverage, in conjunction with prohibiting working while in school is an operational policy that would greatly reduce dropout while maintaining the gains in achievement.