Stellar populations in barred galaxies save an imprint of the influence of the bar on the host galaxy's evolution. We present a detailed analysis of star formation histories (SFHs) and chemical enrichment of stellar populations in nine nearby barred galaxies from the TIMER project. We used integral field observations with the MUSE instrument to derive unprecedented spatially resolved maps of stellar ages, metallicities, [Mg/Fe] abundances, and SFHs, as well as Hα as a tracer of ongoing star formation. We find a characteristic V-shaped signature in the SFH that is perpendicular to the bar major axis, which supports the scenario where intermediate-age stars (∼2 - 6 Gyr) are trapped on more elongated orbits shaping a thinner part of the bar, while older stars (> 8 Gyr) are trapped on less elongated orbits shaping a rounder and thicker part of the bar. We compare our data to state-of-the-art cosmological magneto-hydrodynamical simulations of barred galaxies and show that such V-shaped SFHs arise naturally due to the dynamical influence of the bar on stellar populations with different ages and kinematic properties. Additionally, we find an excess of very young stars (< 2 Gyr) on the edges of the bars, predominantly on the leading side, thus confirming typical star formation patterns in bars. Furthermore, mass-weighted age and metallicity gradients are slightly shallower along the bar than in the disc, which is likely due to orbital mixing in the bar. Finally, we find that bars are mostly more metal-rich and less [Mg/Fe]-enhanced than the surrounding discs. We interpret this as a signature that the bar quenches star formation in the inner region of discs, usually referred to as star formation deserts. We discuss these results and their implications on two different scenarios of bar formation and evolution.