Based on first-principles calculations, we showed that repeated heterostructures of zigzag graphene nanoribbons of different widths form multiple quantum well structures. Edge states of specific spin directions can be confined in these wells. The electronic and magnetic state of the ribbon can be modulated in real space. In specific geometries, the absence of reflection symmetry causes the magnetic ground state of whole heterostructure to change from antiferromagnetic to ferrimagnetic. These quantum structures of different geometries provide unique features for spintronic applications.