To be illegal, sexual material must meet a specific legal definition of “obscene,” as determined by a judge and jury, and such material can be prohibited. The vast majority of art that contains nudity and sexual content, however, does not meet the legal standard for obscenity.
That said, if you want to avoid conflict over potentially controversial work, you might consider putting particularly graphic material behind a warning to users that some viewers might find your work disturbing. This is a relatively simple way to avoid complaints, either directed to you as the artist or to the service provider hosting your material, since those viewers who might be offended by your work can choose not to click through.
Of course, nothing in the law obligates you to hide legal work in this way. If your intent is to shock or to openly confront difficult issues, you may prefer to forgo providing this kind of warning, and you have the right to do so. But be aware of the requirements in the terms of service of your hosting site, if you're using one, to limit the possibility of having your material taken down.
There have been many state and federal attempts to regulate minors’ access to "indecent" material or material that is otherwise deemed “harmful to minors.” While some of these types of regulations are successfully implemented in the offline world, it is extremely difficult to implement them online, and courts have tended to strike down such laws as unconstitutional burdens on adults’ free speech. Court have instead pointed to filtering software and other user-empowerment tools as the most effective way for parents to shield their children from unwanted content.
This includes material produced using actual children, as well as some “virtual” child pornography: The PROTECT Act of 2003 prohibits cartoons, drawings, digitally manipulated images, and other visual depictions of an apparent minor engaged in sexual activity, if that depiction is also obscene. This is a new and evolving area of the law, and artists depicting minors engaged in sexual acts may face legal risk.