We investigate the growth of matter density perturbations as well as the generalized second law (GSL) of thermodynamics in the framework of $f(R)$-gravity. We consider a spatially flat FRW universe filled with the pressureless matter and radiation which is enclosed by the dynamical apparent horizon with the Hawking temperature. For some viable $f(R)$ models containing the Starobinsky, Hu-Sawicki, Exponential, Tsujikawa and AB models, we first explore numerically the evolution of some cosmological parameters like the Hubble parameter, the Ricci scalar, the deceleration parameter, the density parameters and the equation of state parameters. Then, we examine the validity of GSL and obtain the growth factor of structure formation. We find that for the aforementioned models, the GSL is satisfied from the early times to the present epoch. But in the farther future, the GSL for all models is violated. Our numerical results also show that for all models, the growth factor for larger structures, like the $\Lambda$CDM model, fit the data very well.