If you are a non-EU/EEA student in Germany, you may work "140 full days or 280 half days per year, or up to 20 hours/week". If you want to go beyond that, "special permission needed to exceed this". Self-employment is not allowed.
That is the rule that matters most. Students usually do not get into trouble because they found a job. They get into trouble because they treat a side job like a normal full-time job and stop counting days. If you are unsure how your shifts are being counted, check the official work-and-visa guidance on our Germany guide and then confirm the current rule on the official visa page before you sign anything.


