Child sleeping in their own room.

When do you switch a child over to their own room for them to learn to sleep alone without a problem? Me and my husband and I are talking about when we need to put our daughter in her own room so she won't only sleep with us in the room and get use to it