  We derive relations between the effective radii $R_{\rm{eff}}$ of galaxies
and the virial radii $R_{200c}$ of their dark matter halos over the redshift
range $0 < z < 3$. For galaxies, we use the measured sizes from deep images
taken with \emph{Hubble Space Telescope} for the Cosmic Assembly Near-infrared
Deep Extragalactic Legacy Survey; for halos, we use the inferred sizes from
abundance matching to cosmological dark matter simulations via a stellar
mass--halo mass (SMHM) relation. For this purpose, we derive a new SMHM
relation based on the same selection criteria and other assumptions as for our
sample of galaxies with size measurements. As a check on the robustness of our
results, we also derive $R_{\rm{eff}}$--$R_{200c}$ relations for three
independent SMHM relations from the literature. We find that galaxy
$R_{\rm{eff}}$ is proportional on average to halo $R_{200c}$, confirming and
extending to high redshifts the $z=0$ results of Kravtsov. Late-type galaxies
(with low S\'ersic index and high specific star formation rate [sSFR]) follow a
linear $R_{\rm{eff}}$--$R_{200c}$ relation, with effective radii at $0.5 < z <
3$ close to those predicted by simple models of disk formation; at $z < 0.5$,
the sizes of late-type galaxies appear to be slightly below this prediction.
Early-type galaxies (with high S\'ersic index and low sSFR) follow a roughly
parallel $R_{\rm{eff}}$--$R_{200c}$ relation, $\sim$ 0.2--0.3 dex below the one
for late-type galaxies. Our observational results, reinforced by recent
hydrodynamical simulations, indicate that galaxies grow quasi-homologously with
their dark matter halos.
