Condensed-matter systems that are both low-dimensional and strongly interacting often exhibit unusual electronic properties. Strongly correlated electrons with greatly enhanced effective mass are present in heavy fermion compounds, whose electronic structure is essentially three-dimensional. We realized experimentally a two-dimensional heavy fermion system, adjusting the dimensionality in a controllable fashion. Artificial superlattices of the antiferromagnetic heavy fermion compound CeIn3 and the conventional metal LaIn3 were grown epitaxially. By reducing the thickness of the CeIn3 layers, the magnetic order was suppressed and the effective electron mass was further enhanced. Heavy fermions confined to two dimensions display striking deviations from the standard Fermi liquid low-temperature electronic properties, and these are associated with the dimensional tuning of quantum criticality.