if you are an undergrad paying tuition fees but if you are a PhD student getting a stipend from the institution then the situation is very different.
That is/was a matter of much debate in the US. Basically, our universities wanted it both ways ... salary for some reasons and scholarship for others. As a classic example, consider the NCAA's football "scholarships." They wanted to indenture the athletes and prevent them from selling endorsements all the while universities were profiting from doing the same. Our SCOTUS just decided in limited favor of the athletes.
In my day (1960's), the issue came down to income taxes (gifts are not generally taxable) and "welfare" eligibility, particularly if married. Most grad students stipends, say $199/mo, qualified one for welfare. If salary, the uni's would also have to meet minimum wage. The solution was that you had to pay taxes (minimal) and were not eligible for welfare as it was deemed voluntary poverty.
I don't know what the results are today with "retail" tuitions in the $50,000/year ($24/hr for 2080 hours/year). However, in the US, copyright belongs to the creator unless there is a
written agreement to the contrary. As for the TS, I suspect there is no such agreement, unless this is one of those generic "what if" questions to which there is no generic answer.