Data from ISD Scotland revealed there were more than 22,000 complaints during 2014/15.
Ministers have attributed the rise to the inclusion of complaints from within the prison service after health boards changed the system to include prisoners in 2013/14.
Complaints from prisoners made up the largest share at 4,277, an increase of 41 per cent last year. Of those complaints, 63 per cent were not upheld.
Overall, there were 13,723 complaints about hospital and community health services, with 30 per cent fully upheld.
Treatment was the biggest issue, featuring in 45 per cent of those complaints, followed by staff at 28 per cent and waiting times at 15 per cent.
There were also 7,422 complaints about family health services, with 36 per cent relating to treatment and 29 per cent relating to staff.
Health boards need to do more to learn from patient complaints, said Dr Jean Turner, patron of the Scotland Patients Association.
Dr Turner, a former GP, said: “I think people are less likely to put up with a bad situation than years ago when many people might not have made a fuss or did not think anything would happen if they spoke up.
“The government has tried to encourage people to make official complaints, which is a good thing, but I don’t think that is the only reason to explain the increase.
“There has got to be learning from the top down to bring about a change in culture. Staffing levels also need to be in place so people are safe to do their jobs to the best of their ability.
“There is still a lot to learn from the complaints procedure and health boards need to make sure they are listening.”
Scottish Liberal Democrat health spokesperson Jim Hume MSP said: “It would be unwise of the Health Secretary to continue to seem oblivious to the real pressures experienced by health boards and the fact that this could have a detrimental impact on the patient experience.
“Our hospitals are treating more patients with fewer staff.
“We are grateful to NHS staff for the hard work they do. Their job has been made no easier by the SNP Government, which continues to take its eye off the ball to talk about its independence plans.”
The increased complaints reflect a greater confidence that their complaint will be listened to and better awareness of how to give feedback, said health secretary Shona Robison.
She said: “In the overwhelming majority of cases the NHS does a fantastic job. However, in an organisation of this size, which deals with such a vast and increasing number of patients, there will be occasions when people’s experiences of the NHS do not meet their expectations.
“When that happens boards must listen to and act on that feedback.”
Ms Robison added: “Prisoners have the same right to make complaints as every other patient and over the last two years prisoners have been able to better access the complaints procedure. This has driven some of the increases we have seen in complaints over the last two years.
“It is also true that our NHS is busier than ever before and we all demand the highest possible quality service when either ourselves or our loved ones receive treatment.
“That is why we are investing record amounts and have record staffing levels in place to ensure our NHS gets it right and delivers the kind of high quality treatment we rightly demand for every patient.”