I agree with Fionas - more to do with how well I know the family and how well DS knows the parents - would he be comforted by them if he woke in the night.
I have had a friebnds daughter (DS1s v close friend) over to stay about 3 times - started just before they turned 4. we are all good friends thouggh and the kids know us all well. we have some other friends we would also do this with. works best for us with 'family friends'.
in terms of friends from school/kinder where I dont have a relationship with the parents - def a while off.