Context. CoRoT-2, the second planet-hosting star discovered by the CoRoT satellite, is a young and active star. A total of 77 transits were observed for this system over a period of 135 days. Aims. Small modulations detected in the optical light curve of the planetary transits are used to study the position, size, intensity, and temporal evolution of the photospheric spots on the surface of the star that are occulted by the planetary disk. Methods. We apply a spot model to these variations and create a spot map of the stellar surface of CoRoT-2 within the transit band for every transit. From these maps, we estimate the stellar rotation period and obtain the longitudes of the spots in a reference frame rotating with the star. Moreover, the spots temporal evolution is determined. This model achieves a spatial resolution of 2 • . Results. Mapping of 392 spots vs. longitude indicates the presence of a region free of spots, close to the equator, which is reminiscent of the coronal holes observed on the Sun during periods of maximum activity. With this interpretation, the stellar rotation period within the transit latitudes of −14.• 6 ± 10 • is obtained from the auto-correlation function of the time-integrated spot flux deficit, which yields a rotation period of 4.48 days. With this period, the temporal evolution of the spot surface coverage in individual 20 • longitude bins has periodicities ranging from 9 to 53 days with an average value of 31 ± 15 days. On the other hand, the longitude integrated spot flux, which is independent of the stellar rotation period, oscillates with a periodicity of 17.7 days, and its false-alarm probability is ∼3%. Conclusions. The rotation period of 4.48 days obtained here is shorter than the 4.54 days derived from the out-of-transit light modulation. Because the transit data sample a region close to the stellar equator while the period determined from out-of-transit data reflects the average rotation of the star, this is taken as an indication of a latitudinal differential rotation of about 3% or 0.042 rad/d.