  We calculate the evolution of gas giant planets during the runaway gas
accretion phase of formation, to understand how the luminosity of young giant
planets depends on the accretion conditions. We construct steady-state envelope
models, and run time-dependent simulations of accreting planets with the
Modules for Experiments in Stellar Astrophysics (MESA) code. We show that the
evolution of the internal entropy depends on the contrast between the internal
adiabat and the entropy of the accreted material, parametrized by the shock
temperature $T_0$ and pressure $P_0$. At low temperatures ($T_0\lesssim
300$--$1000\ {\rm K}$, depending on model parameters), the accreted material
has a lower entropy than the interior. The convection zone extends to the
surface and can drive a large luminosity, leading to rapid cooling and cold
starts. For higher temperatures, the accreted material has a larger entropy
than the interior, giving a radiative zone that stalls cooling. For $T_0\gtrsim
2000\ {\rm K}$, the surface--interior entropy contrast cannot be accommodated
by the radiative envelope, and the accreted matter accumulates with high
entropy, forming a hot start. The final state of the planet depends on the
shock temperature, accretion rate, and starting entropy at the onset of runaway
accretion. Cold starts with $L\lesssim 5\times 10^{-6}\ L_\odot$ require low
accretion rates and starting entropy, and that the temperature of the accreting
material is maintained close to the nebula temperature. If instead the
temperature is near the value required to radiate the accretion luminosity,
$4\pi R^2\sigma T_0^4\sim (GM\dot M/R)$, as suggested by previous work on
radiative shocks in the context of star formation, gas giant planets form in a
hot start with $L\sim 10^{-4}\ L_\odot$.
