This year I'll move to Frankfurt for a semester and I have to go to Heidelberg every day because I'll study there. I couldn't figure out which ticket I should buy. Can you please inform me about it?
Hilmar is already giving a rather general answer to your question. I will focus on finding the cheapest option for you.
The basic thing you have to ask yourself is whether you wish to use regional trains only or IC trains as well. Frankfurt-Heidelberg is around 90 minutes with the direct RE train or 60 minutes with the direct IC train. Both trains run once every hour at least.
Since you will already have the VRN semester ticket from Heidelberg University, you can travel as far north as Zwingenberg with it free of charge in all regional transport including city transport (busses/trams) in Heidelberg. From Zwingenberg onwards it will be the RMV transport authority getting you to Frankfurt. RMV monthly tickets from Frankfurt to Zwingenberg will cost you 229,30 Euros, so around 1500 for half a year. Even if you then would have two separate tickets, there is no problem in taking the direct trains, of course.
So, when taking regional trains only, you will have to pay 1500 Euros for half a year. And you will have Frankfurt city transport included. Which is probably very OK since you are living there!
For the other option, using IC trains, I disagree in buying a Bahncard. The DB Zeitkarte (a monthly ticket for long distance trains) is much more suitable. It will cost you 278 Euros per month from Frankfurt to Heidelberg. It does not include Frankfurt city travel and cannot make use of your VRN ticket which you can still use in Heidelberg of course. But you wouldn't have city transport in Frankfurt included. So for the long distance option you would pay around 1700 Euros, be a little faster (you can also use the RE service) but miss out on the Frankfurt transport option.
In my opinion, the regional trains option is suitable better for your needs. Especially, since long distance trains happen to be delayed a lot (more than the RE trains) and you'll end up taking the regional train anyways.
For completeness' sake: Buying a Bahncard 50 and buying each trip separately will cost you 128 Euros for the Bahncard (you'll pay half as you are a student) as well as around 1600 for the reduced tickets. Interestingly, separate IC tickets are only 1.15 Euros more expensive than RE tickets, so this will give you 180 Euros more for all separate IC tickets. Still more expensive than the above options.
Also, please note that there seems to be a lot of construction going on, so that as of now there are only 4 direct IC trains between Frankfurt and Heidelberg. With this in mind, the RE trains seem to be the only viable option for you!
This is a somewhat unusual (and long) commute, so it's not covered by any of the local transportation networks (Nahverkehr) and you will need a regular train ticket from the Bundesbahn www.bahn.de
These typically only cover the actual train ride, so if there is also local transport involved (bus, S-bahn, subway) you may have to buy this extra.
As a student you can get a Semesterticket. This is tied to your place of study and not to your place of residence, so it would come from Heidelberg can cover the VRN area https://www.vrn.de/tickets/tarifsystem/wabensystem/index.html It covers "slow" regional trains (RE, RB und S-Bahn) but not fast trains (IC or ICE).
The Bahn offers a "volume" discount though it' Bahncard program https://www.bahn.com/en/view/offers/bahncard/bahncard.shtml. A one way from Frankfurt to Heidelberg will run you about 20 Euro without a card and goes down to 15 and 10 and 0 depending on Bahncard level
Depending on where your exact locations and how often you are planning on going, it's probably best to game out a few scenarios and see which ones work out the best. My hunch is that taking the Semesterticket in conjunction with a Bahncard 50 or Banhcard 25 will probably work best.
The winter semester has around 15 weeks, that's 75 days or 150 round trips. So you are looking at around 3000 Euro in train tickets. Spending 255 Euro on a Bahncard 50 knocks this down to about half of it, so that seems like a worthwhile Investment. If you have the Semesterticket, you would only need the train ticket for that part of the journey that's in Hessen and the Semester ticket would cover the rest. But that only works if you stick to slow train in the VRN area.
Another option would be to take a monthly ticket from the RMV that covers all of Hessen (up to Biblis or Gernsheim, I think) and then use the Semesterticket for the parts in Baden-Württemberg. Again, making a spreadsheet with a few scenarios would help with that.