  This paper constructs a theoretical framework for calculating the
distribution of masses for gas giant planets forming via the core accretion
paradigm. Starting with known properties of circumstellar disks, we present
models for the planetary mass distribution over the range $0.1M_J < M_{\rm p} <
10M_J$. If the circumstellar disk lifetime is solely responsible for the end of
planetary mass accretion, the observed (nearly) exponential distribution of
disk lifetime would imprint an exponential fall-off in the planetary mass
function. This result is in apparent conflict with observations, which suggest
that the mass distribution has a (nearly) power-law form $dF/dM_{\rm p}\sim
M_{\rm p}^{-p}$, with index $p\approx1.3$, over the relevant planetary mass
range (and for stellar masses $\sim0.5-2M_\odot$). The mass accretion rate onto
the planet depends on the fraction of the (circumstellar) disk accretion flow
that enters the Hill sphere, and on the efficiency with which the planet
captures the incoming material. Models for the planetary mass function that
include distributions for these efficiencies, with uninformed priors, can
produce nearly power-law behavior, consistent with current observations. The
disk lifetimes, accretion rates, and other input parameters depend on the mass
of the host star. We show how these variations lead to different forms for the
planetary mass function for different stellar masses. Compared to stars with
masses $M_\ast$ = $0.5-2M_\odot$, stars with smaller masses are predicted to
have a steeper planetary mass function (fewer large planets).
