Let's say your goal is to build more endurance (i.e., core or lean conditioning). In order to build more endurance it's best to lift no more than 67% of your 1-rep max (1-RM) for loads. At this intensity level you will be able to perform high repetitions (e.g., > 12 reps) at a moderately-fast speed. As a result, you should spend at least 30s up to 40s duration per set and no more than 30s rest between sets. The 30s to 40s exercise duration provides enough time-under-tension (TUT) for your muscles to adapt to the exercise stimulus with regard to endurance under relatively low loads. In addition, the relatively short rest period of no more than 30s allows your heart rate to remain elevated to boost your metabolic rate--ideal for burning bodyfat.
What if your fitness goal is to build more muscle mass (i.e., bodybuilding)? In this case it's best to lift within the range of 67 to 80% of your 1-RM. At this intensity level you will be able to perform moderately-high repetitions (e.g., between 8 to 12 reps) at a moderate speed. Here again you should spend at least 30 to 40s duration per set but your rest period may last from 30 to 90s due to the increased loading. The exercise duration needs to last at least a half-minute in order for adequate TUT for muscle adaptation with regard to muscle hypertrophy (growth) to occur. The rest duration of up to 1.5 minutes should suffice in allowing your heart rate to decelerate enough to begin the next set.
Maybe your fitness goal is to build more strength. In order to build more strength it's best to lift between the range of 80 to 85% of your 1-RM. At this intensity level you will be able to perform moderately-low repetitions (e.g., between 6 to 8 reps) at a moderately-slow pace. Since the weight is relatively high you should spend about 20 to 30s per set with a rest period lasting from 2 to 5 minutes. Spending up to 30s per set at such a relatively heavy weight provides adequate TUT for muscle strength to be activated. Allowing up to 5 minutes for recovery between sets may be needed in order for your heart rate to decelerate enough before resuming your next set.
Finally, let's say your fitness goal is to increase power (i.e., sport performance). Power depends on the amount of work done within a certain period of time: P = W / t where P=power, W=work and t=time. Recall that work is simply the amount of force applied over a particular distance, or W = F * d where F=force and d=distance. So power is the amount of force applied over a certain distance within a time duration, or P = F * d / t. In this case, the force may at be least 85% of your 1-RM or less than 45% of your 1-RM. When the force or load is high (e.g, 85% 1-RM), overall distance travelled by the weight will be relatively low because muscle fatigue will only allow a limited amount of repetitions (e.g., less than 6 reps). Thus, force (F) is high while distance (d) is low over a short duration (t) which allows for a relatively high power (P). When the force is low (e.g., 45% 1-RM), overall distance travelled by the weight will be relatively high because muscle fatigue will not occur until a high amount of repetitions (e.g., more than 30 reps). Thus, force (F) is low but distance (d) travelled is high due to many repetitions that can be performed under a low load, again allowing for a relatively high power (P). Therefore, power training may done via heavy weight for short durations or light weight for longer durations. As a result, the repetition speed may either be slow under heavy loads or fast under light loads. Therefore, the set duration may last anywhere between 10s under heavy loads to a minute under light loads. Accordingly, rest durations may last anywhere between 1 to 5 minutes. Under light loads, a minute may be all that's needed for recovery whereas heavy loads require up to 5 minutes for your heart rate to be adequately decelerated.