We study the star formation and the mass assembly process of 0.3<=z<2.5 galaxies using their IR emission from MIPS 24um band. We used an updated version of the GOODS-MUSIC catalog, extended by the addition of mid-IR fluxes. We compared two different estimators of the Star Formation Rate: the total infrared emission derived from 24um, estimated using both synthetic and empirical IR templates, and the multiwavelength fit to the full galaxy SED. For both estimates, we computed the SFR Density and the Specific SFR. The two SFR tracers are roughly consistent, given the uncertainties involved. However, they show a systematic trend, IR-based estimates exceeding the fit-based ones as the SFR increases. We show that: a) at z>0.3, the SFR is well correlated with stellar mass, and this relationship seems to steepen with redshift (using IR-based SFRs); b) the contribution to the global SFRD by massive galaxies increases with redshift up to ~2.5, more rapidly than for galaxies of lower mass, but appears to flatten at higher z; c) despite this increase, the most important contributors to the SFRD at any z are galaxies of about, or immediately lower than, the characteristic stellar mass; d) at z~2, massive galaxies are actively star-forming, with a median SFR 300 Msun/yr. During this epoch, they assemble a substantial part of their final stellar mass; e) the SSFR shows a clear bimodal distribution. The analysis of the SFRD and the SSFR seems to support the downsizing scenario, according to which high mass galaxies have formed their stars earlier and faster than their low mass counterparts. A comparison with theoretical models indicates that they follow the global increase in the SSFR with redshift and predict the existence of quiescent galaxies even at z>1.5, but they systematically underpredict the average SSFR.