Babies can get to know their fathers through hearing the fathers voice through the mothers womb so when they get out of the mothers womb they typically know their father by instinct and by voice.
When babies are first born their vision is blurry but as they reach two weeks old their vision becomes a bit better and they can recognize their mother and father once they get used to them holding them.
Sometimes it takes as long as until the baby turns 2 years old until they can easily recognize both their mother and father.