For my wife and I it's not usually a problem because we're usually up much later than most people, so our guests usually leave long before we have to consider how best to encourage them to leave. When we visit people we always make it clear that if they need us to head out they can just tell us, as we are routinely up much later than people who have to work early.
Most of the people we know who aren't retired start work at 7:30 or earlier. I work at whatever times suits me so a lot of our friends have done an hour or two of work by the time I wake up, but then sometimes I'm working into the small hours because I got my teeth into something and don't want to let it go.