Dear Student,
The force acting on an object hanging on a spring is gravity and tension.
Gravity: Gravity is an attractive force that exists between all the matter. It causes any two objects in the universe to be drawn to one another.
Tension: Tension is a force which comes into play when you pull or stretch an elastic material. It always acts opposite to the direction of pull or stretch. The elastic property of the material tries to neutralize this pull or stretch and restore the original configuration of the material when the external force is removed.
Regards