While the vast majority of schools across the country provide lessons, it was found that more than half of pupils did not participate in sexual health lessons.
The survey, carried out by HIV Scotland, spoke to 2,806 students in 418 schools in Scotland.
It found that 16% of pupils reported only receiving sexual health lessons less than a few times a year and 41% did not know where to go for sexual health services.
On HIV, 34% of students said they did not know how to minimise HIV risk, with few aware of transmission and prevention.
Just over a quarter believe that HIV can be transmitted through kissing, 45% through spitting and 34% via toilet seats.
Half of all students said they wanted more information on HIV transmission at school.
The charity wants to challenge stigma around HIV.
Nathan Sparling, head of policy and campaigning at HIV Scotland, said: “This is the largest survey of young people in Scotland, specifically focused on their experiences of sexual health education in schools.
“We heard from 2,806 students from Orkney to Dumfries & Galloway and right across the central belt.
“It shows that students in Scotland need and want better sexual health education, that informs them about the modern-day realities of HIV and how to prevent it.
“Let’s be clear, HIV cannot be transmitted through spitting, kissing or toilet seats.
“When people living with HIV are on effective treatment, the virus is reduced to such a low level in their body that they are not able pass the virus on to others.
“These facts should be used to inform new generations about HIV, challenging stigma at the same time.”