Hello Fadiyaho,
Welcome to the Wefugees Community and thank you for reaching out to us. All students who have a temporary residence permit for the purpose of studying (§ 16) can pursue a part-time student job (such as student assistant, work at the Asta or the Studierendenwerk). Other activities may amount to 120 full working days or 240 half working days (max. 4 hours per day) per year. Secondary employment must be approved by the Foreigners' Registration Office. This is to ensure that you are actually studying. This restriction does not apply to students who have a permanent residence permit.
A general change from a stay for the purpose of studying to a stay for the purpose of working is not possible. If you discontinue your studies, you must leave the country. You said you are married. Here it is worth clarifying whether a stay through your wife would be possible. For this, I recommend that you contact a local migration counselling centre or clarify it in a confidential counselling session via MBEON. You are welcome to write to me at mbeon. I wish you all the best.
Gabriele