  The core accretion hypothesis posits that planets with significant gaseous
envelopes accreted them from their protoplanetary discs after the formation of
rocky/icy cores. Observations indicate that such exoplanets exist at a broad
range of orbital radii, but it is not known whether they accreted their
envelopes in situ, or originated elsewhere and migrated to their current
locations. We consider the evolution of solid cores embedded in evolving
viscous discs that undergo gaseous envelope accretion in situ with orbital
radii in the range $0.1-10\rm au$. Additionally, we determine the long-term
evolution of the planets that had no runaway gas accretion phase after disc
dispersal. We find: (i) Planets with $5 \rm M_{\oplus}$ cores never undergo
runaway accretion. The most massive envelope contained $2.8 \rm M_{\oplus}$
with the planet orbiting at $10 \rm au$. (ii) Accretion is more efficient onto
$10 \rm M_{\oplus}$ and $15 \rm M_{\oplus}$ cores. For orbital radii $a_{\rm p}
\ge 0.5 \rm au$, $15 \rm M_{\oplus}$ cores always experienced runaway gas
accretion. For $a_{\rm p} \ge 5 \rm au$, all but one of the $10 \rm M_{\oplus}$
cores experienced runaway gas accretion. No planets experienced runaway growth
at $a_{\rm p} = 0.1 \rm au$. (iii) We find that, after disc dispersal, planets
with significant gaseous envelopes cool and contract on Gyr time-scales, the
contraction time being sensitive to the opacity assumed. Our results indicate
that Hot Jupiters with core masses $\lesssim 15 \rm M_{\oplus}$ at $\lesssim
0.1 \rm au$ likely accreted their gaseous envelopes at larger distances and
migrated inwards. Consistently with the known exoplanet population,
Super-Earths and mini-Neptunes at small radii during the disc lifetime, accrete
only modest gaseous envelopes.
