What happenes to a star's mass and gravity when it dies?
When a star "dies" it just means that it has stopped outputting energy and is harder to see. All of the mass and hence gravity is still there.
When a star dies it means that it has run out of nuclear fuel and can no longer generate sufficient amounts of energy to be seen from far away. Stars end up as some kind of remnant: a white dwarf, neutron star or black hole.
Even though the star may no longer be visible, all of its mass still exists. It will still have a gravitational effect.
In fact stars other than our Sun have such a small gravitational effect on Earth that it is unmeasurable.