Nearly all New Testament scholars believe that Mark's Gospel was written first1, and that Matthew and Luke were substantially based on that original gospel. So when Mark 6:3-4 says in the context of his return to his home town that Jesus was a carpenter, some weight must be given to this statement unless there are reasons for not doing so.
It seems that such a lowly profession might have been a source of some embarrassment in early Christian communities2. Matthew's Gospel, the next to be written, avoids saying that Jesus was a carpenter, merely saying in the parallel passage (Matthew 13:55-57) that he was the son of a carpenter. The next gospel, Luke makes no mention of either Joseph or Jesus having been a carpenter, writing instead that when Jesus returned to his home town he preached in the synagogue (Luke 4:16-24). If these two synoptic gospels were substantially derived from Mark, there is no reason to believe that they knew more about Jesus than did the author of Mark's Gospel. John's Gospel follows Luke in making no reference to a carpenter.
Dennis R MacDonald, compares Jesus to Odysseus in The Homeric Epics and the Gospel of Mark and finds many plausible parallels between the sufferings of Jesus and those of Odysseus. He proposes that the portrayal of Jesus as a carpenter was based on Odysseus' references to his own carpentry skills. If MacDonald is correct in his analysis, which continues to be debated among scholars, then Jesus was probably not a carpenter.
In conclusion, the best biblical source for this information is Mark's Gospel, which tells us that Jesus was a carpenter. Further scholarly analysis may provide some evidence that even the author of Mark's Gospel did not have certain knowledge of this, but filled in missing details about Jesus, from the Homeric epics.
Many scholars believe that the author of Luke-Acts extensively used themes and details from the works of the first-century Jewish historian, Josephus. A particularly relevant parallel is reported by Jewish Virtual Library:
Josephus relates of himself that in his youth he was so renowned for his knowledge of the Torah that high priests and leading men of the city would come to consult him on matters of halakhah, and he was apparently distinguished in his youth as an aggadist.
On its own, this does not prove that Luke's reference to Jesus discussing the scriptures with learned men at a similar age (Luke 2:46), was based on Josephus' egocentric account, but the presence of many other parallels supports such a conclusion. The alternative, implied by Luke, is that only by a miracle could the son of a poor village carpenter be able to hold the learned men entranced by his knowledge at such a tender age.
1Adam Winn (The Purpose of Mark's Gospel, page 1) says the theory of Markan priority is one of the few that has reached a high level of consensus among New Testament interpreters.
2 See, for example, Jesus the Magician, page 22, by Morton Smith