The factor that affects elastic potential energy but not gravitational potential energy is the spring constant.
Elastic potential energy is stored in objects that can be deformed (like springs) when they are compressed or stretched, and it is dependent on the spring constant and the distance the spring is stretched or compressed from its equilibrium position. In contrast, gravitational potential energy depends on the mass of the object and the height above a reference point, and it is influenced by the acceleration due to gravity. Therefore, the spring constant is the correct answer.