It all depends. I've never actually stayed until the casket is completely buried though. In my family, usually once the graveside ceremony is over then you leave, even before the casket is lowered.
At my MIL's funeral they lowered it but we were actually by the car before they did, so we saw them putting the first shovelfuls of dirt on the casket but we didn't stay around until it was completely done.
As for the families keeping the deceased in the living room, that dates back to way back when. My grandfather died before I was ever born (actually before my mom was married), my grandmother always talks about how she always thought that was a silly tradition but her and my grandpa had discussed it and she would have never known he wanted someone to stay up 24 hours with him (someone always stayed awake for the first 24 hours), since she knew he wanted it so, she did it. We didn't do that with her though (I have never known it to be done around here). When we talked about this, I was told that the origin of this came because it was originally to keep animals from getting to the deceased before they could be buried and just has stuck as a tradition.