We all know how much it sucks to be the first one to walk in the door, but it definitely gives a much worse impression to show up late. Try to be prompt with work parties – they aren't as casual as some of your other functions as they deal with co-workers and not just peers. Also be conscious of the host – if your boss’s wife planned the whole event, be sure to thank her for her graciousness before leaving.
Never leave before the food is served, and wait at least an hour after. If the event isn't catered, offer to help clean up. Be sure to put in a sufficient amount of time and seem genuinely interested in being there before you take off. We all have lives, that’s obvious, but it’s important to prioritize the people you work with and to make them feel a part of your life as well.