Find a standard reduction potential table. Magnesium is very active and Copper is not - Copper is the cathode where reduction and formation of copper from copper ions takes place.
Cu2+ + 2e- ⇒ Cu (find this reduction reaction and write down potential (= Ered)
Mg ⇒ Mg2+ + 2e- (find the reverse of this reaction in the table and multiply the potential by -1 (= Eox)
Ered + Eox = ET (no adjustments necessary for 1M standard solutions.