  We study the recent star formation histories of local galaxies by analyzing
the scatter in their colours and spectral properties. We present evidence that
the distribution of star formation histories changes qualitatively above a
characteristic stellar surface mass density of 3x10^8 M_sol kpc^-2,
corresponding to the transition between disk-dominated and bulge-dominated
galaxies. When we average over subpopulations of galaxies with densities below
this value, we find that subpopulations of all masses form their stars at the
same average rate per unit stellar mass. However, the scatter in galaxy colours
and emission line strengths is larger for more compact galaxies of a given
mass. This suggests that star formation occurs in shorter, higher amplitude
events in galaxies with smaller sizes. Above the characteristic density, galaxy
growth through star formation shuts down. We propose that star formation events
are triggered when cold gas is accreted onto a galaxy. We have used the new
high resolution Millennium Simulation of structure formation in a concordance
LCDM Universe to quantify the incidence of these accretion events and we show
that the observational data are well fit by a model in which the consumption
time of accreted gas decreases with the surface density of the galaxy as t_cons
\propto mu*^-1. The dark matter halos hosting massive galaxies with high
densities are also expected to grow through accretion, but the observations
indicate that star formation in bulge- dominated galaxies is no longer coupled
to the hierarchical build-up of their surrounding dark matter halos.
