In general, all people are free to choose if they want to have sex, and with whom they want to have sex.[source?]
There is a certain age, called the age of consent. People younger than this age cannot agree that they want to have sex with someone. Often, there are exceptions to this, so that people who are about the same age do not fall under this rule. People who are unable to consent, for example because they are sleeping, or unconscious or because they have a mental illness are also protected by that rule.