It actually depends entirely on the laws of the state or country being delt with as well as an unoffical theory called the law of maximum screws.
In most of America the legal age is 18 with 16 and 17 being able to give consent to anyone and most states recognize a 2 year leeway on sexual play for those who are underage - that is as long as the partner(s) are within two years and consenting the activity is legal, otherwise the oldest individual is consideredto be at fault for stautatory rape no matter who inititated the act. Some states recoginze 17 as legal, but nationwide is considered to be 18.
Other countries put different numbers in that legal age blank, ranging from 13 to 21, 18 and 21 simply being commonly used numbers. This isnt to say any of it is right, or smart, or moral, or wise, its simply what the lawmakers in those regions have come up with.
As for the law of maximum screws it boils down to this: In cyberspace you have a physical location where you are at a console, the data to upload or download also has a physical location, anyone who views data you upload into a server also has a physical location, and anyone who uploads has one as well. Routers that channel infromation from a server - no matter how impractical they path may be - also have locations. Sounds dry and boring as hell right? But heres the catch. Anyone who uploads or downloads data can be in violation of any law in any region that this data enters. So if a movie was filmed in Singapore, uploaded in France, routed through America, and winds up on a console in Vancouver, it is subject to every single one of those countries, states, provinces, countys, and city laws it passed through. Plan ahead and stay safe.