A conservative estimate:This question is difficult to answer if you do not specify what kind of pattern recognition you refer to. In the context of human development, pattern recognition can be as simple as recognizing a row of dots as a line (Gestalt perception) or experiencing the pop-out effect (see Treisman's feature integration theory), but it can also be as complex as face recognition, speech recognition, or reading. Nevertheless, the complexity of a pattern recognition ability does not necessarily correlate with the time of its acquisition. Face recognition, for instance, happens to work pretty early.
There is good evidence (e.g., Pascalis et al 1995) that 4 days old newborns can recognize their mother's face. This, an ability that definitely requires pattern recognition (in. Note that this example is a rather conservative estimate: if the broad sense as specified in bynewborn is able to detect its mother's face at the OP)forth day, it was able to detect faces probably earlier.
AAs a more liberal estimate: Therethere are reports of unborn children that respond to certain voices or certain kinds of music already in their mother's womb (for instance being calmed by certain pieces of music). This should definitely require pattern recognition.
References
Pascalis O, de Schonen S, Morton J, Deruelle C, Fabre-Grenet M. (1995) Mother's face recognition in neonates: a replication and an extension. Infant Behavior and Development 17:79–85.