34 Matthew's narrative is continued thus: “Now when Jesus had heard that John was cast into prison, He departed into Galilee.” Mark states the same fact, as also does Luke, only Luke says nothing in the present section as to John being cast into prison. The evangelist John, again, tells us that, before Jesus went into Galilee, Peter and Andrew were with Him one day, and that on that occasion the former had this name, Peter, given him, while before that period he was called Simon.
Likewise John tells us, that on the day following, when Jesus was now desirous of going forth unto Galilee, He found Philip, and said to him that he should follow Him. Thus, too, the evangelist comes to give the narrative about Nathanael. Further, he informs us that on the third day, when He was yet in Galilee, Jesus wrought the miracle of the turning of the water into wine at Cana. All these incidents are left unrecorded by the other evangelists, who continue their narratives at once with the statement of the return of Jesus into Galilee.
Hence we are to understand that there was an interval here of several days, during which those incidents took place in the history of the disciples which are inserted at this point by John. Neither is there anything contradictory here to that other passage where Matthew tells us how the Lord said to Peter, “You are Peter, and upon this rock will I build my Church.” But we are not to understand that that was the time when he first received this name; but we are rather to suppose that this took place on the occasion when it was said to him, as John mentions, “You shall be called Cephas, which is, by interpretation, A stone.” Thus the Lord could address him at that later period by this very name, when He said, “You are Peter.”
For He does not say then, “You shall be called Peter,” but, “You are Peter;” because on a previous occasion he had already been spoken to in this manner, “You shall be called.”
Source: The Harmony of the Gospels (New Advent)