HOW MUCH TIME YOU NEED TO SPEND IN THE GYM ?
In order meet certain goals, it's not about how much time you spend there at the gym. It's about How it's spent in the gym. A person that is trying to grow and gain muscle while remaining lean is much more different than a marathon runner. And similarly if a person just wants to loose fat the workout routine of him/her would be different.
Lets say If you are wanting to build muscle and lose fat then intense workouts is key in obtaining your goal. Lifting heavy combined with intensity and then intense cardio but short duration puts you in a great spot to build muscle, burn fat and obtain your desired physique.
If you are working out for longer hours ,your body may go into catabolic state i.e it may start using your muscles as fuel. You may not want that .. Do you ?
So just stick to the basics and workout according to your goals, the quantity time you spent in the gym does'nt matter but the quality time you spent does.If you are overtraining your muscle, it may do more of harm to you than doing any good and may even increase your chances of injury.
Know your limits and stop when you are done.