Context. The efficiency of the different processes responsible for the evolution of interstellar dust on the scale of a galaxy are, to date, very uncertain, spanning several orders of magnitude in the literature. Yet, precise knowledge of the grain properties is key to addressing numerous open questions about the physics of the interstellar medium and galaxy evolution. Aims. This article presents an empirical statistical study, aimed at quantifying the timescales of the main cosmic dust evolution processes as a function of the global properties of a galaxy. Methods. We modeled a sample of 800 nearby galaxies, spanning a wide range of metallicities, gas fractions, specific star formation rates, and Hubble stages. We derived the dust properties of each object from its spectral energy distribution. Through an additional level of analysis, we inferred the timescales of dust condensation in core-collapse supernova ejecta, grain growth in cold clouds, and dust destruction by shock waves. Throughout this paper, we have adopted a hierarchical Bayesian approach, resulting in a single large probability distribution of all the parameters of all the galaxies, to ensure the most rigorous interpretation of our data. Results. We confirm the drastic evolution with metallicity of the dust-to-metal mass ratio (by two orders of magnitude), found by previous studies. We show that dust production by core-collapse supernovae is efficient only at very low metallicity, a single supernova producing on average less than 0.03 M /SN of dust. Our data indicate that grain growth is the dominant formation mechanism at metallicity above 1/5 solar, with a grain growth timescale shorter than 50 Myr at solar metallicity. Shock destruction is relatively efficient, a single supernova clearing dust on average in at least 1200 M /SN of gas. These results are robust when assuming different stellar initial mass functions. In addition, we show that early-type galaxies are outliers in several scaling relations. This feature could result from grain thermal sputtering in hot X-ray emitting gas, which is a hypothesis supported by a negative correlation between the dust-to-stellar mass ratio and the X-ray photon rate per grain. Finally, we confirm the well-known evolution of the aromatic-feature-emitting grain mass fraction as a function of metallicity and interstellar radiation field intensity. Our data indicate that the relation with metallicity is significantly stronger. Conclusions. Our results provide valuable constraints for simulations of galaxies. They imply that grain growth is the likely dust production mechanism in dusty high-redshift objects. We also emphasize the determinant role of local, low metallicity systems in order to address these questions.