normally you must be married and live together (after marrige) in Germany for 3 years (§31.1 Residence Act - Aufenthaltsgesetz). In this case you can keep and prolong your residence permit after divorce. The important point is living together as a family. If you still stay married but separate yourself (and in Germany stopping a family relation for 1 year is in most cases the condition to be divorced) and the Ausländerbehörde knows about separation, this time doesn't belong to three years, although you haven't been divorced yet.
An exclusion can be made, if it is a special hard case (the person is very sick, was a victim of family violence etc.)
If there is no such reason in your situation, it can be really difficult. Probably the Ausländerbehörde wouldn't do anything in the time that your residence permit is valid, but then they wouldn't prolong it, if they find out about separation. Perhaps they will first give you a so called "Fiktionsbescheinigung", which means that they check possibility of prolonging. It is good that you have a job and don't need social help. Without job the Ausländerbehörde mostly starts pressure on people to leave Germany quicker and harder.
You can try to change your residence permit as a husband of a german woman to a residence permit for another aim (for example work, professional training, studies) but it is often not possible from Germany, because you came with another aim and the Ausländerbehörde can insist on a new visum procedure.
This is general information. For your individual case it is important to consult a good councelling center for migrants in your area (perhaps they know how the Ausländerbehörde in your place is) or a good lawyer for alien law.