Generally speaking, the birth mother – in practical terms – will have “custody” of a newborn until the child reaches an age where the other parent can appropriately care for the child, independently from the birth mother.
In some circumstances, the Court may consider it appropriate for a newborn child to be placed into the primary care of the other parent or a relative.
However, this would likely only occur if there were significant risk issues associated with the birth mother (e.g., mental health concerns, illicit drug-taking, or a risk of fleeing with the child) and it was not considered safe for the newborn to remain in her care.