The Scottish Conservatives said the figures gave "serious cause for concern".
Since 2019/20, 226 investigations have been launched in relation to under 18s going missing from NHS grounds. And when it comes to adults, Police Scotland have had to undertake 5,297 missing person investigations between 2019/20 and 2022/23 so far.
NHS Greater Glasgow and Clyde and NHS Lothian accounted for more than 2,600 of the adults who were reported missing, while the latter saw 56 youngsters reported missing from its grounds.
The figures are contained in a written response from SNP Justice Secretary Keith Brown to Conservative MSP Jamie Greene.
The Tories warned the total number could be even higher as the figures only include those disappearances reported to the police.
Mr Greene, his party’s justice spokesman, said: “These figures are deeply alarming. Relatives expect their loved ones to be safe while they are staying, or being treated, in an NHS facility.
“It gives serious cause for concern that over 200 investigations have had to be launched in just the last few years to determine the whereabouts of young people who went missing from NHS grounds.
“These young people will have felt extremely vulnerable and could have been at risk of serious harm after leaving the care of our dedicated NHS staff.
“The fact that thousands of investigations have taken place all points to frontline staff burnout on the SNP’s watch. Due to shortages of staff across Scotland’s NHS and the shattering toll of the pandemic, they have been pushed beyond breaking point. Exhaustion and under-staffing leads to incidents like this.
“But, of course, there’s a knock-on effect for our already-overstretched police too, who are having to investigate these disappearances. Officer numbers are at their lowest level since 2008 – and they too are being asked to do too much.
“Keith Brown cannot dismiss these figures out of hand. They should be an urgent wake-up call for him to ensure that he gives our police the resources they need, and his colleague [Health Secretary] Humza Yousaf does the same for the NHS.
“Relatives must be given a guarantee by ministers that there is not a risk of their loved ones suddenly going missing while under the supervision of our health service.”
A Scottish Government spokeswoman said: “The National Missing Persons Framework for Scotland aims to protect some of Scotland’s most vulnerable individuals and ensure that the families and loved ones left behind are supported. The framework enables multi-agency working, ensuring a consistent response is in place for vulnerable people and 99 per cent of all missing people are returned safely.
“The mental health workforce has expanded significantly in recent years, with staffing numbers at a record high. The Scottish Government has increased direct mental health investment, and there are currently record numbers of staff providing more varied support and services to a larger number of people than ever before.
“Despite this workforce expansion, we know that some children and young people are still waiting too long for treatment. In our NHS recovery plan, we have committed to provide sufficient funding for around 320 additional staff in children and adolescent mental health services over the next five years.”