Matthew, Mark and Luke tell us that a period of at least forty days separated Jesus's baptism from his return to Galilee. Mark (1:9-15) writes,

9 At that time Jesus came from Nazareth in Galilee and was baptized by
John in the Jordan. 10 Just as Jesus was coming up out of the water,
he saw heaven being torn open and the Spirit descending on him like a
dove. 11 And a voice came from heaven: “You are my Son, whom I love;
with you I am well pleased.” 12 At once the Spirit sent him out into the wilderness, 13 and he was
in the wilderness forty days, being tempted by Satan. He was with
the wild animals, and angels attended him. 14 After John was put in prison, Jesus went into Galilee, proclaiming the good news of God. 15 “The time has come,” he said. “The kingdom of God has come near. Repent and believe the good news!”

John on the other hand appears to give no room for a forty day temptation. John indicates that only a few days elapse between Jesus' baptism and the return to Galilee. John delineates the days:

"the next day" (1:35)

"spent that day with him" (1:39)

"the next day" (1:43)

"On the third day" (2:1)

On that third and final day Jesus has already returned to Cana of Galilee.

1 Answer
1

Short Answer: There is no contradiction. John is not claiming that Jesus went into Galilee immediately after His baptism -- he is claiming that Jesus went into Galilee immediately after the day recorded in 1:29-34 -- a day in which John the Baptist testified to the Jews that he had already baptized Jesus some time prior. So, to answer the question directly, it would seem (based on what we know from Scripture) that Jesus went to Galilee at least 40 days after His baptism.

Let's examine carefully what John is saying (and why.) First, John testified via his Gospel...

. . . so that you may believe that Jesus is the Christ, the Son of God; and that believing you may have life in His name. -John 20:31

Now let's follow John's narrative flow from the opening verses in Chapter 1.

1-18 provides numerous testimonies about the true identity of Jesus as the Christ, the Son of God -- including John the Baptist's

19-28 has John the Baptist telling the Jews that his purpose is to testify about the true identity of the Christ

29-34 has John the Baptist actually testifying that Jesus is the Christ

35ff has John the Baptist's disciples responding to his testimony and following Jesus, the Christ

Before we move on to reconciling accounts, it is important to recognize that the reason John included this information was to convince his readers to believe that Jesus was the Christ, and he was using John the Baptist's testimony as evidence of this. He was not including this information for the purpose of chronicling Jesus' baptism; His readers already knew about that from the Synoptic tradition. (See here for more on that.)

Now let's take a look at the day recorded in 1:29-34.

The next day [John the Baptist] saw Jesus coming to him and said, “Behold, the Lamb of God who takes away the sin of the world! This is He on behalf of whom I said, ‘After me comes a Man who has a higher rank than I, for He existed before me.’ I did not recognize Him, but so that He might be manifested to Israel, I came baptizing in water.”

John testified saying, “I have seen the Spirit descending as a dove out of heaven, and He remained upon Him. I did not recognize Him, but He who sent me to baptize in water said to me, ‘He upon whom you see the Spirit descending and remaining upon Him, this is the One who baptizes in the Holy Spirit.’ I myself have seen, and have testified that this is the Son of God.”

In other words, John the Baptist saw Jesus approaching, and said: "Look! There He is! That's the Christ!" ...But he then goes on to explain that he did not recognize Him as the Christ prior to His baptism, because it wasn't until he baptized Him that he saw the Spirit descending on Him, and could thereby identify Him as the Christ.

So John the Baptist must have already baptized Jesus prior to saying that. How many days prior? I don't know, but it could have easily been 40 days prior.

So, in summary, there is no reason to think that this passage is evidence that John's Gospel is historically inaccurate, or inconsistent with the historical claims of the Synoptics.

@Jas 3.1 Help me with this; I was about to ask a question and found Matthew Miller’s here. In Mark 1:8 John baptizes Jesus. Only a few verses later, in Mark 1:14, John has already been imprisoned, Jesus has returned to Galilee, and Jesus/his disciples are doing the baptizing. I’m thinking those 7 verses cover a long stretch of time. In John 1 to John 2:2, John baptizes Jesus, who then goes to the wedding in Cana. Three chapters later, in John 4, Jesus returns to Galilee, John has been imprisoned and Jesus/the disciples are doing the baptizing. John 4:1-3 “Therefore when the Lord
–
John MartinJul 11 '14 at 17:55

@Jas 3.1 ...knew that the Pharisees had heard that Jesus was making and baptizing more disciples than John 2 (although Jesus Himself was not baptizing, but His disciples were), 3 He left Judea and went away again into Galilee.” Q: Is Mark 1:8-14 be the same stretch of time as John 1:9 to John 4:2 was?
–
John MartinJul 11 '14 at 18:04

@JohnMartin Without splitting hairs, yes, I think that your observation seems reasonable. For further validation, the Reese Chronological Bible has John 1:35-4:42 as happening between Mark 1:13 and Mark 1:14.
–
Jas 3.1Jul 11 '14 at 18:09