We resolve spatially the star formation history of 300 nearby galaxies from the CALIFA integral field survey to investigate: a) the radial structure and gradients of the present stellar populations properties as a function of the Hubble type; and b) the role that plays the galaxy stellar mass and stellar mass surface density in governing the star formation history and metallicity enrichment of spheroids and the disks of galaxies. We apply the fossil record method based on spectral synthesis techniques to recover spatially and temporally resolved maps of stellar population properties of spheroids and spirals with galaxy mass from 109 to 7×1011 M⊙. The individual radial profiles of the stellar mass surface density (μ⋆), stellar extinction (AV), luminosity weighted ages (〈logage〉L), and mass weighted metallicity (〈log Z/Z⊙〉M) are stacked in seven bins of galaxy morphology (E, S0, Sa, Sb, Sbc, Sc and Sd). All these properties show negative gradients as a sight of the inside-out growth of massive galaxies. However, the gradients depend on the Hubble type in different ways. For the same galaxy mass, E and S0 galaxies show the largest inner gradients in μ⋆; and Andromeda-like galaxies (Sb with log M⋆ (M⊙) ∼ 11) show the largest inner age and metallicity gradients. In average, spiral galaxies have a stellar metallicity gradient ∼ −0.1 dex per half-light radius, in agreement with the value estimated for the ionized gas oxygen abundance gradient by CALIFA. A global (M⋆-driven) and local (μ⋆-driven) stellar metallicity relation are derived. We find that in disks, the stellar mass surface density regulates the stellar metallicity; in spheroids, the galaxy stellar mass dominates the physics of star formation and chemical enrichment.