You need to prioritize your needs over others' wants. You also need to get used to dealing with disappointed faces. It's honestly fine. Put yourself in their shoes; if you hoped that someone would help you and got turned down, would you be all smiles? Probably not. But disappointment with the situation doesn't mean they're disappointed in you specifically.
You want to know how you can be both gentle in turning people down, but firm and in a way that will get others to appreciate you. Let's address each point in order:
Being Gentle
As with most things, the situation is rather nuanced. You've been consistently providing help, and now you've suddenly stopped. If I were your classmate, I might wonder if it's my fault and if you're simply too nice to tell me to my face that I've overstepped my boundaries. When letting them down, imply that you're swamped by other issues rather than by theirs. This will emphasize to them that you're not upset with them.
I personally also say I'm sorry when I'm not able to help. This may be a cultural thing, as I'm in the US, so I feel compelled to point out that the apology is not about remorse, but rather out of empathy, i.e. it is a gesture of good will, not an expression of guilt. People tend to be a lot kinder in response, in my opinion. If apologizing feels wrong, you could also say: "I wish I could help." Based on your question, this seems like a true enough statement and also makes your rejection feel gentler, because it appears to be out of your hands.
If I am used to using certain resources, I'll also forward them along. Links to textbooks, helpful StackExchange posts, old notes of mine, etc. are all fair game if I like the asker enough. This also incentivizes people to be nice to me, rather than to approach me only to ask favors.
Being Firm
You already acknowledged that you don't owe anyone your help. For that reason, you shouldn't have to explain yourself, either. However, omitting any explanation whatsoever can seem a bit callous even if you're in the right. If that's what you prefer, then you also need to accept the social consequences of being standoffish.
However, I'd say the key is to not cave into peer pressure while emphasizing the reason you can't help. If you give in after being asked a few times, people won't take your rejection seriously. They'll see "being busy" as a flimsy excuse, a euphemism for not wanting to help others. If you say that you have a lot of homework at the time they're asking, stick to that. It demonstrates that your time is important, and that you can only help conditionally.
Getting Appreciated
Getting appreciated is always a tricky thing. Honestly? Your altruism will most likely be underappreciated no matter what you do. As the comments above suggested, some people will not take "no" for an answer. Full stop. Some people are entitled, arrogant, and an absolute pain to even attempt to help. If you're willing to give, many will be more than happy to take. You're not going to see a return on your gesture, and that's something you just need to accept sometimes. For me, it's actually a good motivator to spend my time only on those who actually deserve the help.
However, I've generally noticed that busy people who occasionally help others (but on their terms) tend to garner more respect than those who help all the time (or not at all). Here's an example dialogue:
A: "Hey, Fred. I need help with this math problem. Do you have a
minute?"
You: "I actually need to finish this assignment right now.
If I finish it early, I will let you know."
A: "I'm really confused,
though, and it's due tomorrow. Can you help me after class?"
You: "I
have to go to a club meeting. But if you bring it to me after my club
meeting, I can help you for a few minutes before I catch my bus
home."
A: "I can't do that, though. I have a swim meet."
You: "Then I
unfortunately can't help you, as much as I wish I could. However,
maybe [resource] can help?"
;tldr
You can't really control what others feel or do. Emphasize that you want to help because you care, but that you are unable. Most importantly, stick to taking care of yourself FIRST even when under pressure.
I hope this was helpful. I'm in my twenties and still learning how to say "no" properly, but I have faith in you, young Padawan!