It's good idea to familiarise yourself with basic gym manners so that you don't put your foot in it and put yourself off going back again after someone complains. Most of it is pretty simple stuff that any polite person would do anyway.
Firstly – sweat. Everyone sweats and its just a part of being at the gym, if you aren't sweating you aren't working hard enough and may as well not be there. But people don't appreciate having it shared around unnecessarily. Always bring at least one towel to the gym to wipe off the machines after you've used them. Some bring a towel to wipe off the machines prior to their workout, and you may need another to use for the shower afterwards. And if you are particularly prone to producing moisture, you may need another to wipe yourself down to stop it dripping around the place and on to other people.
Whilst we're on the subject of sweat, deodorant is a must have during all sessions. Although this may seem like a fairly obvious point, it's surprising the amount of people that forget. And yes, women can smell as equally bad as men. Weight rooms can sometimes be fairly limited on space, and the last thing someone wants when their breathing heavily in their final lift is to get a lungful of your BO.
Always share the equipment, particularly during busy periods. Don't ever just sit around, text, chat or even take a nap on equipment you're not using, and don't take longer than necessary on one machine. If someone asks you how much longer you'll be, or how many reps you have left, answer them honestly. It's not uncommon for people to ask to 'work in' with you – this simply means that they will complete a set during your rest time, and then you swap. You should always oblige – one day you may need the same from someone else. In fact, it's polite to offer if someone asks you how long you have left.
Also to do with equipment – tidy up after your done. No need to go into detail, just put things back as you found them. It's just common courtesy, and people don't want to be tripping up over dumbbells or stacking someone elses plates for them. Also, don't drop the weights. It damages the equipment, makes a lot of noise, and as triumphant as you may feel finishing a set, it's completely unnecessary. You should have enough strength left to lower the weight to the ground, and people will look badly on you if you drop them.
Try and keep the noise to a minimum. Grunting and moaning won't help you complete your set, and it's distracting to those around you.
Although many people will enjoy chatting or talking about training techniques in the weights room, try to be sensible about it. Don't ask someone in the middle of their set a training question, and don't have half an hour long discussions about your personal life. Also, try and be nice – there's no need to make fun of other gym members, especially as a beginner. You'll only make enemies and make yourself look like an idiot. And watch your language – you're still in a public place and you don't know who you might offend.
It's polite to give people room. Squeezing past machines can be dangerous and distracting – just wait for them to finish their set. Also distracting is to stare at people – this goes for women and men. Yes she may look exactly as you want to in a years time, and yes he might have the most delicious looking abs you've every seen. But try and control yourself – it's quite rude, and most people won't find it flattering.
Finally, leave your bag in the locker room. Taking it into the weights room just takes up space and gives people something to trip over. You don't need your phone during a workout – you should be concentrating anyway, and it's annoying to other gym members.