This magnesium ion will have a charge of +2. This is because it retained the same number of protons and neutrons, but the loss of 2 electrons (with negative charge) means that there are now 2 extra protons compared to electrons, and those 2 protons give a net charge of +2.