Aims. We investigate the chemical evolutionary history of the dwarf spheroidal galaxies Leo 1 and Leo 2 by means of predictions from a detailed chemical evolution model compared to observations. The model adopts up to date nucleosynthesis and takes into account the role played by supernovae of different types (Ia, II), allowing us to follow in detail the evolution of several chemical elements (H, D, He, C, N, O, Mg, Si, S, Ca, Fe, Ba, and Eu). Methods. Each galaxy model is specified by the prescriptions of the star formation rate and by the galactic wind efficiency chosen to reproduce the main features of these galaxies, in particular the stellar metallicity distributions and several abundance ratios. These parameters are constrained by the star formation histories of the galaxies as inferred by the observed color-magnitude diagrams, indicating extended star formation episodes occurring at early epochs, but also with hints of intermediate stellar populations. Results. The main observed features of the galaxies Leo 1 and Leo 2 can be very well explained by chemical evolution models according to the following scenarios: the star formation occurred in two long episodes at 14 Gyr and 9 Gyr ago that lasted 5 and 7 Gyr, respectively, with a low efficiency (ν = 0.6 Gyr −1 ) in Leo 1, whereas the star formation history in Leo 2 is characterized by one episode at 14 Gyr ago that lasted 7 Gyr, also with a low efficiency (ν = 0.3 Gyr −1 ). In both galaxies an intense wind (nine and eight times the star formation rate -w i = 9 and 8 in Leo 1 and Leo 2, respectively) takes place which defines the pattern of the abundance ratios and the shape of the stellar metallicity distribution at intermediate to high metallicities. Conclusions. The observational constraints can only be reproduced with the assumption of gas removal by galactic winds.