If this problem is since the beginning, it is because of the separation anxiety disorder wherein the child has not been exposed to sufficient social environment independently. Here, parents and the child both need counselling and behaviour therapy.
If this problem starts at a later age, it suggests that some stressful event has occurred with the child. Take your child into confidence and ask them the reason behind this behaviour. If your child refuses to answer, don’t pressurise him/her. Consult a clinical psychologist who will be able to help your child better.