Scholars tend to agree that Joseph had died prior to Christ's ministry. Catholic tradition represents Mary as a widow during the adult ministry of Christ. Joseph is not mentioned as being present at the Wedding at Cana at the beginning of Jesus' mission, nor at Golgotha. If he had been present at the Crucifixion, he would under Jewish custom have been expected to take charge of Jesus' body, but this role is instead performed by Joseph of Arimathea (see Luke 23:50-53). Nor would Jesus have entrusted his mother to John's care had her husband been alive (see John 19:27).
One explanation given for his death is given in the apocryphal Gospel of James (written ~145AD), supposed to be authored by or a protoevangelium of James—Jesus brother—which claims that James was actually Joseph's son from a previous marriage. The canon gospels never mention Joseph's age, but this account of James presents Joseph as an old man who was called of God to look after the virgin Mary. If this account is accurate, then the explanation for Joseph's absence later in in Christ's life would be attributed to him passing from old age.
The life of Joseph actually has its own field of study called Josephology. Records of devotions to Saint Joseph go back to the year 800AD and Doctors of the Catholic Church since Saint Thomas Aquinas have written on the subject. With the growth of Mariology, the theological study of Saint Joseph also grew and several centers of study were formed in the 1950s specifically for study of Joseph—Husband of Mary. The modern study of the theology of Saint Joseph is one of the most recent theological disciplines.