I think it will depend on your specific role/institution/country. My postdoc is in a UK institution and funded by a research council. When I fell pregnant I applied for a) maternity leave from the University as a member of staff (full pay for 5 months, statutory maternity pay for 5 months) and b) an extension from the funding body.
If you have been in the role for the required amount of time (check your institutions maternity policy) you might be eligible for paid maternity leave. How much pay etc will depend really on your situation. I believe that in the UK you are allowed to request leave irrespective of length of employment, but I don't think you will necessarily be entitled to pay. In my case I was required to take at least 2 weeks, but I needed much longer to recover.
For some projects you might find that your PI will want to replace you during your maternity leave rather than extend the project, but I can't give you any advice on this other than to fight for an extension if you can - obviously extra time is better.