Everything we know about the husband of Mary and the foster father of Jesus comes from Scripture and that has seemed too little for those who made up legends about him.
We know he was a carpenter, a working man, for the skeptical Nazarenes ask about Jesus, "Is this not the carpenter's son?" (Matthew 13:55). He wasn't rich for when he took Jesus to the Temple to be circumcised and Mary to be purified he offered the sacrifice of two turtledoves or a pair of pigeons, allowed only for those who could not afford a lamb (Luke 2:24).
Despite his humble work and means, Joseph came from a royal lineage. Luke and Matthew disagree some about the details of Joseph's genealogy but they both mark his descent from David, the greatest king of Israel (Matthew 1:1-16 and Luke 3:23-38). Indeed the angel who first tells Joseph about Jesus greets him as "son of David," a royal title used also for Jesus.
We know Joseph was a compassionate, caring man. When he discovered Mary was pregnant after they had been betrothed, he knew the child was not his but was as yet unaware that she was carrying the Son of God. He knew women accused of adultery could be stoned to death, so he resolved to send her away quietly to not expose her to shame or cruelty. However, when an angel came to Joseph in a dream and told him, 20 "Joseph son of David, do not be afraid to take Mary home as your wife, because what is conceived in her is from the Holy Spirit. 21 She will give birth to a son, and you are to give him the name Jesus, because he will save his people from their sins," he did as the angel told him and took Mary as his wife. (Matthew 1:19-25).
When the angel came again to tell him that his family was in danger, he immediately left everything he owned, all his family and friends, and fled to a strange country with his young wife and the baby. He waited in Egypt without question until the angel told him it was safe to go back (Matthew 2:13-23).
We know Joseph loved Jesus. His one concern was for the safety of this child entrusted to him. Not only did he leave his home to protect Jesus, but upon his return settled in the obscure town of Nazareth out of fear for his life. When Jesus stayed in the Temple we are told Joseph (along with Mary) searched with great anxiety for three days for him (Luke 2:48). We also know that Joseph treated Jesus as his own son for over and over the people of Nazareth say of Jesus, "Is this not the son of Joseph?" (Luke 4:22)
We know Joseph respected God. He followed God's commands in handling the situation with Mary and going to Jerusalem to have Jesus circumcised and Mary purified after Jesus' birth. We are told that he took his family to Jerusalem every year for Passover, something that could not have been easy for a working man.
Since Joseph does not appear in Jesus' public life, at his death, or resurrection, many historians believe Joseph probably had died before Jesus entered public ministry.
According to the Catholic Encyclopedia, the Apocryphal Date for Joseph's birth is 90 BC in Bethlehem and the Apocryphal Date of his death is July 20, AD 18 in Nazareth.
Joseph is the patron saint of the dying because, assuming he died before Jesus' public life, he died with Jesus and Mary close to him, the way we all would like to leave this earth.
Joseph is also patron saint of the Universal Church, families, fathers, expectant mothers (pregnant women), travelers, immigrants, house sellers and buyers, craftsmen, engineers, and working people in general.