Most people aim at 45 minutes or so, plus time for warmup, cooldown and stretches - an hour in all.
It's easier to think of it in terms of the sets and the rest between them.
For example, if your goal is general fitness and strength, you're looking at 6-10 exercises with about 3 sets each, and you want to be fitter so you have only 1 minute rest between sets. Allowing 1 minute to load up the bar and actually do the set, and it's 2 minutes per set. 6-10 exercises x 3 sets x 2 minutes = 36-60 minutes.
If your goal is strength, then you're looking at 3 exercises with 4-6 sets each, and you need more rest time - say 3 minutes. Again, 1 minute to load the bar and do the set, 4 minutes per set in all. 3 exercises x 4-6 sets x 4 minutes = 48-72 minutes.
Thus, general fitness workouts will be a bit quicker, strength workouts a bit longer. An hour is traditional, most people are tired by then anyway.