The jet fragmentation function describes the longitudinal momentum distribution of hadrons inside a reconstructed jet. We study the jet fragmentation function in proton-proton collisions in the framework of soft-collinear effective theory (SCET). We find that, up to power corrections, the jet fragmentation function can be expressed as the ratio of the fragmenting jet function and the unmeasured jet function. Using renormalization group techniques, we are able to resum large logarithms of jet radii R in the perturbative expansion of the cross section. We use our theoretical formalism to describe the jet fragmentation functions for light hadron and heavy meson production measured at the Large Hadron Collider (LHC). Our calculations agree very well with the experimental data for the light hadron production. On the other hand, although our calculations for the heavy meson production inside jets are consistent with the PYTHIA simulation, they fail to describe the LHC data. We find that the jet fragmentation function for heavy meson production is very sensitive to the gluon-to-heavy-meson fragmentation function.