Students receive a residence permit on the basis of a letter of guarantee from the university, which states that a foreigner is really enrolled in an educational institution at a certain faculty. The period of study is also indicated in the document, it is for these dates that a residence permit is issued.
It is much easier for students who have received a Hungarian diploma to obtain permanent residence, and in the future, Hungarian citizenship.