The need for and the etiquette of going away from the keyboard (AFK) was stronger in WoW's earlier days. During classic WoW, 5-manning places like Blackrock Depths was an all-night affair. Players were more forgiving of a quick dash to the bathroom, and groups doing longer content tended to schedule natural breaks along the way. Today's WoW is a much more terse affair. Scenarios, group instances, and raids are likely to be over long before your bladder is. It's not so difficult to simply plan ahead or wait for a group to come to a natural conclusion.
Yet people don't always do that. Like That Guy who's always texting and checking his Twitter feed instead of looking you in the eye during a conversation, That Guy in game is likely to wander AFK just when you need him the most. Tuning out the people you're with, online or off, simply is not socially acceptable behavior. (You've heard what they're calling those tuned-out types who'll be wearing Google Glass, right? It's not a complimentary term.)
The best way to handle going AFK is to avoid it in the first place. For the rest of those moments when something comes while you're grouping that's beyond your control, let's look at the best ways of managing the interruption and getting you back into the game.