Here are some basic rules of thumb in order to get along with everyone in the gym and not make the trainer working on the other side of the room boil with barely surpressed annoyance. :)
Basically, it's all about the golden rule. Be considerate and respectful of others.
1) Wipe the machines. Even if you don't sweat all over everything, it's just a nice thing to do.
2) Don't sit on a machine doing nothing. Someone is probably waiting for it whether you realize it or not. This includes taking really long rest times between sets. Your workout will be ineffective anyway if you wait 5 minutes between working.
3)If someone asks if they can "work in", they want to know if they can use the machine during your rest periods. It's like playing through slower players on the golf course. If it's completely impractical, politely decline, but when possible, share.
4) Observe time limits on cardio machines when people are waiting. You wouldn't want to be on the other end, waiting for someone who keeps going for another 10 minutes.
5) Don't grunt, sing or talk on your cell phone while you're working out in a room full of people trying to focus on what they're doing.
Play nice, and everyone's workout will be more enjoyable. Happy exercisers get better results!