See Matthew ch. 2. Though St Matthew's account may leave the impression that the flight into Egypt was almost immediate, it would have been at least forty days after Christ's birth, following His Presentation in the Temple (Luke ch. 2). Christ, his holy Mother and his adoptive father St Joseph probably remained in Egypt for several years, until the death of Herod the Great.
St Nikolai Velimirovic (in the Prologue) relates the following tale: the holy family, fleeing into Egypt, were accosted by robbers, one of whom, seeing the Christ Child, was amazed at his supernatural beauty and said 'If God were to take human flesh Himself, He would not be more beautiful than this child!'. The robber told his companions to take nothing from the family. In gratitude the Mother of God told him 'This Child will reward you richly for having spared Him today.' Thirty years later it was this robber who was crucified at Christ's right hand, and was granted to hear the words 'Today shalt thou be with Me in Paradise.'