(This is advice based on US laws, and may not be applicable for other countries.)
The appropriate time to let them know is after you get a job offer, but before you start. Alison at AskAManager gives this advice for mentioning a short vacation, not a long parental leave:
“I’m interviewing for a job. When should I mention that I have a one-week vacation already planned and paid for that’s coming up three months from now?”
Don’t bring it up in the interview stage; it would be premature then. The time to raise it is once a company makes you an offer. At that point, it’s very, very normal to say something like, “I have a trip scheduled from April 15-27. I’m willing to take the time unpaid since I assume I won’t have accrued enough vacation time by then, but I want to make sure up-front that that’s okay.” It’s a lot better to mention this as part of the offer discussion, so that they don’t feel like you’re springing it on them later.
This happens all the time, and it’s totally normal to say this. It may, however, be an issue if you don’t bother to mention it until after you start. So make very sure that you mention it during the offer conversations.
However, at this link, she is talking about someone who is pregnant, and whether it is you or a spouse, the same advice applies:
tell them once you get the offer.
I wouldn’t raise it before you get an offer, because even at many family-friendly places and even despite the law that prohibits discriminating based on pregnancy, plenty of interviewers are still going to think, “We have that big event right when she’ll be out on maternity leave, and candidate B, who is not pregnant, would be able to be there for it.” It’s human nature. Don’t risk that.
But you’re pretty safe raising it once you have the offer, because rescinding it that point would look an awful lot like pregnancy discrimination, which is prohibited by law.