You could also be generic about it: "I'm going to be away for a few weeks for a medical thing. You don't need the gory details, but my parents thought this would be a good time to address it. It's not cancer or anything, but addressing this should improve my quality of life."
Mental health is part of overall health, so it is accurate to say it's medical. If you have some friends who are especially considerate or close to you, you could choose to tell them more one-on-one (using words like what Arthas and one suggest). You might give those friends instructions on how/whether you want them to tell the other friends about it.
By suggesting the phrase, "It's not cancer or anything," I don't want to minimize what you're facing, but it might help keep the others from imagining that they need to visit you in your hospital bed before you die. You could honestly say, "It's not life-threatening" instead, if it's not linked to suicidal thoughts for you.
I had a friend in college who took a year off for mental health reasons. She made up a reason she wouldn't be there for a year, and it wasn't until we became better friends later that she told me the real reason. I wasn't offended or anything, especially because it was probably stressful to say goodbye to everyone and would've been overwhelming to have to share the details with everyone and teach them about mental illness and deal with their reactions.
By the way, I'm so glad you thought to ask about this on SE. My parents would have been oblivious to the whole emotional aspect of leaving school and feeling embarrassed about it, and I wouldn't have known who else to ask for advice.