The primary factor that affects the weight of an object is its mass, as weight is calculated as the force due to gravity acting on that mass (Weight = mass × gravitational acceleration). Additionally, the location of the object can also affect its weight due to variations in gravitational acceleration at different points on Earth (for example, weight is slightly less at higher altitudes).
Therefore, the correct option from your list is:
mass and location of the object.
Shape and energy do not directly affect weight in the context of gravitational force.