Hi @nikoleigh30
It is not clear from your question what kind of residence permit you have in mind. If you will be entitled to a residence permit on the basis of your child, then you should apply for this at your immigration office (Ausländerbehörde) before your current visa runs out. You could be entitled to a residence permit on the basis of your child if the child will have German or EU nationality or the other parent has a residence permit. However, in the latter situation you are not automatically entitled to a permit. I would have to know more about your situation.
Applying in time for a permit means your current visa is extended until the immigration office makes a decision on your application. By the time they process your application, the child will be born and you will receive a permit.
If having a child does not entitle you to a residence permit, then you should apply for an extension of your current visa due to the pregnancy. In German, the period of time before and after the birth of a child is called ‘Mutterschutz’. It goes from 6 weeks before the birth to 8 weeks after it. In this time period you cannot be expected to leave Germany and so will get at least an extension for this time. You may get additional extensions to allow you to get a passport for your child.
If you are not entitled to a residence permit, you may be given the extension paper ‘Fiktionsbescheinigung’ or a paper called a ‘Grenzübertrittsbescheinigung’. The type of paper you have is important as it will affect things like your access to health insurance, social welfare etc.
I recommend you make contact with an advisory service for pregnant women. This is called a ‘Schwangerenberatungsstelle’ and they are offered throughout Germany. It is open to everyone, regardless of your immigration situation. It is for free and confidential and usually you can find someone who speaks English.
Best,
Éanna