How does gamma decay change the nucleus?
See below. Too long to put directly in this space.
Gamma ray emission does not, of itself, change the atomic or mass number of a nucleus. But it usually accompanies an emission of alpha or beta particles and those are what changes the atomic and mass numbers.
Reminders for alpha and beta decay:
Beta decay does not change the mass number but it can make the atomic number increase or decrease by one, as described in the next two paragraphs.
A beta particle is either an electron or a "positron". A positron is like an electron but with positive charge; it combines with an electron to destroy them both and give off stil more gamma rays.
If an electron is emitted, like carbon-14, the atomic number goes up by one. Giving off the negatively charged electron leaves an extra, positive charge behind, which comes from a neutron also being converted to a proton.
If a positron is given off like carbon-11 (an artificial isotope used in hospitals for PET scans), then it's the opposite; a proton becomes a neutron as the positive charge is lost, and the atomic number goes down by one.