We investigate the structure of two-dimensional partial cubes, i.e., of isometric subgraphs of hypercubes whose vertex set defines a set family of VC-dimension at most 2. Equivalently, those are the partial cubes which are not contractible to the 3-cube $Q_3$ (here contraction means contracting the edges corresponding to the same coordinate of the hypercube). We show that our graphs can be obtained from two types of combinatorial cells (gated cycles and gated full subdivisions of complete graphs) via amalgams. The cell structure of two-dimensional partial cubes enables us to establish a variety of results. In particular, we prove that all partial cubes of VC-dimension 2 can be extended to ample aka lopsided partial cubes of VC-dimension 2, yielding that the set families defined by such graphs satisfy the sample compression conjecture by Littlestone and Warmuth (1986). Furthermore we point out relations to tope graphs of COMs of low rank and region graphs of pseudoline arrangements.