We derive relations between the effective radii R 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 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 eff -R 200c relations for three independent SMHM relations from the literature. We find that galaxy R 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érsic index and high specific star formation rate [sSFR]) follow a linear R 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érsic index and low sSFR) follow a roughly parallel R eff -R 200c relation, ∼ 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.