This paper presents the spatially resolved star formation history (SFH) of nearby galaxies with the aim of furthering our understanding of the different processes involved in the formation and evolution of galaxies. To this end, we apply the fossil record method of stellar population synthesis to a rich and diverse data set of 436 galaxies observed with integral field spectroscopy in the CALIFA survey. The sample covers a wide range of Hubble types, with stellar masses ranging from M ∼ 10 9 to 7 × 10 11 M . Spectral synthesis techniques are applied to the datacubes to retrieve the spatially resolved time evolution of the star formation rate (SFR), its intensity (Σ SFR ), and other descriptors of the 2D-SFH in seven bins of galaxy morphology (E, S0, Sa, Sb, Sbc, Sc, and Sd), and five bins of stellar mass. Our main results are: (a) Galaxies form very fast independently of their current stellar mass, with the peak of star formation at high redshift (z > 2). Subsequent star formation is driven by M and morphology, with less massive and later type spirals showing more prolonged periods of star formation. (b) At any epoch in the past the SFR is proportional to M , with most massive galaxies having the highest absolute (but lowest specific) SFRs. (c) While nowadays Σ SFR is similar for all spirals, and significantly lower in early type galaxies (ETG), in the past Σ SFR scales well with morphology. The central regions of today's ETGs are where Σ SFR reached the highest values (> 10 3 M Gyr −1 pc −2 ), similar to those measured in high redshift star forming galaxies. (d) The evolution of Σ SFR in Sbc systems matches that of models for Milky-Way-like galaxies, suggesting that the formation of a thick disk may be a common phase in spirals at early epochs. (e) The SFR and Σ SFR in outer regions of E's and S0's show that they have undergone an extended phase of growth in mass between z = 2 and 0.4. The mass assembled in this phase is in agreement with the two-phase scenario proposed for the formation of ETG. (f) Evidence of an early and fast quenching is found only in the most massive (M > 2 × 10 11 M ) E galaxies of the sample, but not in spirals of similar mass, suggesting that halo-quenching is not the main mechanism for the shut down of star formation in galaxies. Less massive E and disk galaxies show more extended SFHs and a slow quenching. (g) Evidence of fast quenching is also found in the nuclei of ETG and early spirals, with SFR and Σ SFR indicating that they can be the relic of the "red nuggets" detected at high redshift.