Children should also take a break from screen-based activities every two hours, the guidance said.
They also said technology companies must do more to keep children safe.
The report comes as England's Health Secretary, Matt Hancock, is set to meet bosses at Instagram over the handling of self-harm and suicide content.
What does the guidance recommend parents do?
There are several clear steps for parents, which the chief medical officers say will help keep children safe and healthy.
- not using phones and mobile devices at the dinner table - talking as a family is very important for development
- keeping screens out of the bedroom at bedtime
- talking as a family about keeping safe online and about cyber-bulling and what children should do if they are worried
- not using phones when crossing a road or doing any other activity that requires a person's full attention
- making sure children take a break from screens every two hours by getting up and being active
- policing their own use too - parents should give their children proper attention and quality family time and never assume they are happy for pictures to be shared
Is new legislation needed?
Prof Dame Sally Davies, England's chief medical officer and the lead for the UK, said a code of conduct was definitely needed. She wants to see technology companies invest in systems that properly vet the ages of users - a number of platforms require users to be 13 but these were not properly policed, she said.
The guidance is also critical of what it calls "persuasive design". This refers to techniques used to encourage addictive behaviour, including collecting likes and rewards for performing actions such as sharing pictures.
Dame Sally also wants social media companies to develop better algorithms that push positive content to users. This has already been done for users who search for content that could potentially radicalise them. Instead of being fed material that promotes terrorism, users get content that aims to de-radicalise. Dame Sally said the same thing could happen when people searched for "self-harm" or "suicide".
The chief medical officers' guidance comes after leading paediatricians said last month that parents should worry less about screen use after a review found there was little evidence it was harmful in itself.