Torque is required to rotate a mass, simply because of inertia. (for a non-stationary arm only)
When gravity pulls on the mass, torque is also needed to counter that acceleration.
If your robot arm is rotating on Earth, it'll need to counter both inertia and gravity. So you calculate each individually, then add them up.