It depends on your child and their relationship with their friends. Some kids are ready to have sleepovers with their best friend as young as six years old. This also depends on the parent’s relationship with the friend’s parents.
Typically, most kids are ready for sleepovers around middle school or age 11. But some kids aren’t ready until they are older. There’s no hard and fast rule; just go with whatever you and your child are comfortable with.