The government said keeping the current rules in place would allow more time for 12-15 year olds to be vaccinated.
It said it hoped to be able to lift the restrictions at the "earliest possible time" - but gave no indication of a timescale.
The existing rules on face coverings for school staff will also remain.
It means that secondary school pupils and staff must cover their faces at all times when they are at school.
But primary school staff will only need to wear a face mask when they are moving around the school or in communal areas such as canteens and staff rooms - and there is no requirement for primary school pupils to wear face coverings.
There had been speculation that the rules for secondary pupils could be relaxed after draft guidance - which has not been published - recommended lifting the requirement for face coverings to be worn in the classroom.
However, Scotland's chief medical officer later advised that while there were "encouraging signs", a more cautious approach was needed.
The announcement was welcomed by the EIS teaching union, which said it help to ensure schools were able to remain open while also allowing more time for "ventilation challenges" to be met in schools ahead of winter.
But Scottish Conservative education spokesman Oliver Mundell said the announcement would be a "massive disappointment"for pupil and parents, adding: "Scotland's schools should have been a priority for the SNP but with facemasks in classrooms remaining, young people have once again been sent to the back of the queue.
"Pupils, parents and teachers need to see a plan from the SNP for a return to normal learning as soon as possible."
Education Secretary Shirley-Anne Somerville said the recent decline in Covid cases in Scotland was starting to level off, and it was therefore important to continue to take a cautious approach.
She added: "Progress with vaccinating 12-15 year olds has been remarkable and is already over 40%.
"However, this was only rolled out a few weeks ago and allowing further time will mean that the encouraging figure rises even higher.
"We will continue to monitor case rates on a weekly basis, with a view to lifting restrictions at the earliest possible time."
She acknowledged that the announcement would be disappointing for some pupils and their parents, but said safety had to be the "overriding priority".
The rules on wearing face coverings in English schools were lifted on 17 May.
This is not news we were expecting to hear. It had been understood that relaxations would be made to schools guidance following the October holidays. Instead, we are staying still.
The government says cases aren't falling in the way it had hoped, but that has been the situation for some weeks now. It says it wants more teenagers to be vaccinated.
Will we see further relaxation of these school rules as we head towards the Christmas holidays? Will we stay as we are, or even tighten up on classroom restrictions, as we brace for what could be a difficult winter? It looks like the next month could be crucial.