Welcome to the Wefugees Community and thank your for reaching out to us.
To give you a more tailored answer some more details would have been useful. Which type of residence permit do you have at the moment? If you are holding a residence permit according to §28 of the German Residene Law and you are not married, the seperation from your child's mother will most probably not have an impact as long as you are really taking care of the child. In that case, the §28 residence is related to your German child (which will stay your child in that sense), not to the mother/your partner.
If you are holding a humanitarian residence permit (i.e. according to §25 of the German Residence Act), your residence permit is anyway independent.
Please don't hesitate to get back to us if you want to clarify or discuss your case further.
All the best,