It's not the length of the link that is important it is how far away the center of gravity of the link (or the center of gravity of the hand or the arm) is away from the joint.
The distance from the joint is what is important, not the motor, the motor might be driving the joint from somewhere else through pulleys or belts or whatever, especially for elbow joints where you might want to move the elbow motor closer to the shoulder so the shoulder motor does not have to work as hard just to move the elbow motor. And gears and pulleys or whatever can be used to adjust the gear ratio of the motor to get the required torque at the joint.
Example:
This example is for the worst case when the arm is straight out and held horizontally. If the elbow is bent or holding the load more vertically less force is required because the distance is closer to the shoulder motor. (Hold a bag of potatoes in one hand with your elbow bent close to your body, hold the bag of potatoes with your arm straight out in front of you at eye level, then hold it straight out in front of you. The larger the horizontal distance is between your shoulder and teh bag of potatoes, the harder it is to hold it up.)
-A weight of 0.1kg is held by a hand that weighs 0.2kg.
-The hand is at the end of a uniform bar which is the forearm and is 1m long and weights 0.3kg.
-The elbow motor sits at the elbow joint at weighs 0.4kg.
-The upper arm is a uniform bar that is 2m long and weighs 0.5kg and connects to the shoulder joint which is driven by a motor
The torque required at the *ELBOW JOINT* (not necessarily the elbow motor) is:
(0.1kg*1m) + (0.2kg*1m) + (0.3kg*0.5m) = 0.45kg-m
The torque required at the *SHOULDER JOINT* (not necessarily the shoulder motor) is:
(0.1kg*3m) + (0.2kg*3m) + (0.3kg*2.5m) + (0.4kg*2m) + (0.5kg*1m) = 2.95kg-m
Notice that for all the distances used, it is the distance from the joint of interest to the center of gravity of the component. In this example the upper arm and forearm are uniform so their center of gravity is at the center.
Of course, you're actually supposed to use Newtons rather than kg. But you're probably staying on earth the whole time so 1kg = 9.81N and it makes things easier to visualize.