My house is open any time to family, so it's usual for anyone to wander into our lounge unless they prefer their own comapny in our Quiet Room. Generally when one is invited to visit a friend's in the village, then I'll time my duration of stay only as long as the mug of coffee.
Sensing when it's time to go is pretty normal for me as I know all my friends have varying levels of attention. I've never outstayed my welcome. I get knowing how how long I can stay, unless a friend is asking me to help them with something.