We study the gravitational collapse in modified gravitational theories. In particular, we analyze a general f(R) model with uniformly collapsing cloud of self-gravitating dust particles. This analysis shares analogies with the formation of large-scale structures in the early Universe and with the formation of stars in a molecular cloud experiencing gravitational collapse. In the same way, this investigation can be used as a first approximation to the modification that stellar objects can suffer in these modified theories of gravity. We study concrete examples, and find that the analysis of gravitational collapse is an important tool to constrain models that present late-time cosmological acceleration.