Babies learn to differentiate race pretty early in their lives. From Scientific American:

When babies are five months old, they can distinguish among faces of all races equally well. Past studies show they can, for instance, match a happy sound with many kinds of happy faces with equal ease. Yet by nine months, babies react more swiftly to their own race than others: they differentiate more readily between faces and match emotional sounds with facial expressions faster. A study from the University of Massachusetts Amherst, published in May inĀ Developmental Science, showed that the younger infants use only the frontal part of the brain for the task. By nine months, babies also recruit the occipital-temporal region, where recognition happens in adults.