Rule #1 (and the most important rule): BE ON TIME. Seriously. Leave your house thirty minutes earlier than you need to, and be prepared to sit around for a while. A lot of care and planning went into the evening, the least you can do is be in your place before the bride comes out. If you show up right before the bride, you'll be standing around looking awkward, and generally detracting from the important vow exchange that's about to take place.
Obvious rule is obvious: don't be a drunk asshole
Rule #2: Wait your turn. The bride and groom will get to you when they get to you. You're not at the wedding to hang out with the couple, you're there to support them. If they need you, they'll ask for you. If they don't, they'll just come by and say hi, and you can see them again another time. If you're an out-of-town guest then the couple should spend a little extra time with you, but if you see these friends on a regular basis, don't expect a lot of face time.
Rule #3: Don't compare the day to your own wedding. If you have a funny story that is about weddings, that's okay, but don't brag about how great or how much more expensive your special day was. It's not the right time for your stories of self-indulgence, it's a day to celebrate the newlyweds.
I'm sure there are roughly 1000 more wedding guest don'ts, but they're probably all common sense things like "send back the RSVP card on time" and "dress appropriately". Everyone knows those things, and if they don't they're jerks!