Until what age should I bed-share?
Children are primates in so much that their need for nocturnal security often coincides with the end of breastfeeding. It's a safe bet that around the child's third birthday, at the time when he starts nursery school, bed-sharing will come to an end and he'll go willingly to his own bedroom.
Preparing for sleep after bed-sharing
It's a good idea to prepare your child early for sleeping alone: use his bedroom for siestas, never use bed as a punishment, leave a light on, carry the child into his bed in the night so he wakes up there, associate the bedroom with pleasant moments such as reading and giving hugs so that he likes his bedroom and his bed.
Above all, don't feel guilty if you give in and end up taking your child to bed with you: it can be a bit discomfitting, but if your family's sleep depends on it, then by all means do it! It's more important for a child to have parents who are happy and relaxed rather than exasperated and exhausted from sleepless nights.