If you're working out to build muscle, or to prevent muscle loss, then a good guide to go with is to complete your weight training within 45 minutes. Mainly because I enjoy weight training, I find it difficult to fit in everything I want to within 45 minutes. I usually train for a bit longer, but for no longer than 60 minutes normally. If you train for a longer time too, it's important to put greater emphasis on your nutrition in the hours leading up to your training. Keep that covered.
If you have a weight loss goal then including some cardio exercise can be helpful too. 20 to 30 minutes of cardio, after your weights has been completed is a good amount. If you're doing your cardio at a separate time of day to your weight training, then you can make it a bit longer. Intensity is a big factor, if you are doing very high intensity cardio, then a shorter duration should be adequate.