It depends on your goals.
1-5 reps: 2-5 min rest
6-12: 1,5-2,5 min rest
13+: 1 min rest
I think that's the basic sketch for rest. There are loads of exceptions of course, like dropsets, supersets, and that density training.
I think that you should normally just rest as long as it takes for you to recover from the set, but no longer than that.