Context. Galaxy formation in the current cosmological paradigm is a very complex process in which inflows, outflows, interactions, and mergers are common events. These processes can redistribute the angular momentum content of baryons. Recent observational results suggest that disc formed conserving angular momentum while elliptical galaxies, although they lose angular momentum, determine a correlation between the specific angular momentum of the galaxy and the stellar mass. These observations provide stringent constraints for galaxy formation models in a hierarchical clustering scenario. Aims. We aim to analyse the specific angular momentum content of the disc and bulge components as a function of virial mass, stellar mass, and redshift. We also estimate the size of the simulated galaxies and compare them with observations. Methods. We use cosmological hydrodynamical simulations that include an effective, physically motivated supernova feedback which is able to regulate the star formation in haloes of different masses. We analyse the morphology and formation history of a sample of galaxies in a cosmological simulation by performing a bulge-disc decomposition of the analysed systems and their progenitors. We estimate the angular momentum content of the stellar and gaseous discs, stellar bulges, and total baryons. Results. In agreement with recent observational findings, our simulated galaxies have disc and spheroid components whose specific angular momentum content determine correlations with the stellar and dark matter masses with the same slope, although the spheroidal components are offset by a fixed fraction. The average angular momentum efficiency for the simulated discs is η ∼ 1, while for bulges it is η ∼ 0.10−0.20. For the simulated sample, the correlations found for the specific angular momentum content as a function of virial mass or stellar mass are found not to evolve significantly with redshift (up to z ∼ 2). Both dynamical components seem to move along the correlations as they evolve. The total specific angular momentum of galaxies occupy different positions filling the gap between pure rotational-dominated and dispersion-dominated systems. The scaling relations derived from the simulated galaxies determine a similar relation with the virial radius, which is in agreement with recent observations.