The law, which will take effect in 2015, only covers content, including photos, generated by the individual.
Companies will not have to remove content posted, or reposted, by others. Nor will they have to remove the information from their servers.
The legislation has been welcomed by Common Sense Media, a charity that promotes children’s digital privacy.
"Teens often self-reveal before they self-reflect and may post sensitive personal information about themselves – and about others – without realising the consequences," said chief executive James Steyer in a blog post.
A Pew survey indicated 59% of US youngsters with a social-media profile had deleted or edited something they had posted, and 19% had posted comments, photos or updates they later regretted sharing.
Back in May, Google chairman Eric Schmidt said the internet needed a "delete button".
But not everyone believes it is a good idea.
US think tank the Center for Democracy and Technology (CDT) is concerned websites will not understand what their legal obligations are.
"Our chief concern is that this legal uncertainty will discourage operators from developing content and services tailored to younger users, and will lead popular sites and services that may appeal to minors to prohibit minors from using their services," said CDT’s policy counsel Emma Llanso.
In 2010 the European Commission drew up legislation to allow citizens the "right to be forgotten" but recently a judge ruled websites were not responsible for personal data appearing on their pages. And some experts think the ruling means the legislation is unlikely to go ahead.