Hi @Fetiherk
I presume you are from a non-EU country and studying for a semester in Germany as part of the Erasmus programme. What type of visa do you have? There should be reference to a certain paragraph of the residency law on your visa, for example §16b or §16c Aufenthaltsgesetz.
I cannot say with certainty based on the information you have provided. However, if you have a long-term visa (i.e. not a Schengen visa), it is generally possible to change or extend your residence status without having to leave Germany. This is covered in paragraph 41 of the Aufenthaltsverordnung, here via online translation:
https://***-gesetze--im--internet-de.translate.goog/aufenthv/__39.html?_x_tr_sl=de&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp
Your local Ausländerbehörde will ultimately decide whether this applies in your case. You will have to fulfil the other conditions such as admission to university and sufficient financing for the duration of the studies.
Best,
Éanna