Heating magnesium causes a physical change, not a chemical change. It changes the state of matter from solid to liquid, and if heated further, to gas. But the chemical composition of magnesium remains the same.
However, if you heat magnesium in the presence of air, it will react with oxygen to form magnesium oxide (MgO). This is a chemical change, as the chemical composition of the magnesium has changed.