I don't know exactly. We were never asked for my (now) wife's Visa during the whole process, so I figure as long as you are here legally, you should be fine.
However, marrying in Germany takes a lot of paperwork. You will need to present papers like your birth certificate and if you are not from Germany, you will need an apostille for each paper and then you will need a certified translation to German for both the original paperwork and the apostille.
If you talk to Germans, marrying seems easy, because the administrative offices are all interconnected, so getting a German's birth certificate is a matter of a computer query for the clerk. Getting them to recognize a foreign certificate is a long, costly and tedious process.
Marrying costs a fraction of your income (I think it was around 100€ for us and we both worked full time so that's nothing really, a student couple will probably pay some minimum handling fee) but getting those documents and translations is expensive. I think we paid more than 4000€ on that. Obviously that's paying private companies and so it's free market, you might be able to find a cheaper translator or are okay with waiting longer for the regular bureaucracy of your country instead of doing it by express delivery.
Make an appointment at the Standesamt. They will tell you what they want you to bring. Take good notes and bring a translator if your German is so-so. They are just clerks, sometimes they forget things or misrepresent things because they don't know better themselves. I'm sure some are really good, but I can attest that there are really bad one's too.
So make an appointment and take a list what you need to do to get married. Be prepared for a long and costly list. I'm not sure if type of Visa will be on there, but I'm sure it will be the point that in the end will be easiest to fulfill.