30 minutes a session for a beginner. You can work out longer with weights, but don’t over-train the muscle, three exercises per muscle group is plenty (advanced). If you weight train for more than 60 minutes your probably doing one of two things, over-training or talking too much.
Time limit has nothing to do with weight training. If you’re following your routine it shouldn’t matter, you’ll be done when you’re finished your routine. If anything the only way time comes into play is when you haven’t been in there long enough