How long should you be in the gym?
You will often hear things like, "Do not be in the gym for longer than an hour" or "If you don't lift for at least an hour and a half you wont make progress." These sayings are completely false and the truth is, there is no right or wrong answer. The amount of time that you spend in the gym depends completely on your experience level as well as your fitness goals.
You should be in the gym for as long as it takes to accomplish what your designated workout should be for that day. If you are tracking your progression on your exercises it should be fairly consistent week to week. Depending on energy levels, rest periods, ect... The duration could vary. The key is to go into the gym with an exact plan of attack for the specific muscle groups that you are trying to hit that day. To accomplish everything you are trying to get done could take 30 min, or it could take 90 min. Either way it does not matter as long as the progression is tracked and you are making strength progression week to week.
Always strive for improvement on your key fundamental exercises that you are working on. Stay in the gym for that session as long as you NEED to in order to complete the tasks for the day to improve your body. With added experience over time you will be able to add more to your workload and improve on time efficiency! There is NO right or wrong answer.