
According to Matthew 1:18-25, Mary became pregnant with Jesus while she was engaged (but still unmarried) to Joseph. The passage says that Joseph wanted to break off the engagement when he found out about the pregnancy. But then an angel came to him in a dream, told him about Jesus, and persuaded him to go through with the marriage.
Mary was still a virgin when she gave birth to Jesus, and he was her first child. But at some point there were apparently a number of other children in the family. Evidence for this is found at Matthew 13:55-56 and Mark 6:3, which indicate that Jesus had four brothers and at least two sisters. In these passages the names of the brothers are James, Joses (or Joseph), Simon, and Judas. Sisters are also mentioned, but no names are given.
Some Christians believe that Mary was a virgin throughout her life, and that Jesus was her only child. People who believe this argue that the brothers and sisters mentioned in the gospels must have been step-brothers and step-sisters, or even cousins. However, Luke 2:7 refers to Jesus as Mary's "first-born", thus implying that she had other children later. In fact most biblical scholars believe that all of the mentioned children were sons and daughters of Mary who were born after Jesus.
Joseph was a carpenter, and he presumably taught this trade to Jesus. However, there is evidence that Joseph died prematurely. He apparently didn't accompany Mary to the wedding at Cana, and he doesn't appear in any subsequent part of the story either. Also, according to John 19:27, after the crucifixion Mary went to live at the home of the mysterious Beloved Disciple, which she probably wouldn't have done if her husband had still been alive.
When Jesus left home to begin his ministry, other members of his family apparently disapproved. According to Mark 3:21, they said that he was "out of his mind". This verse also says that there was an attempt to "take charge of him" and bring him home. Matthew 12:46-50 indicates that he refused to talk to his mother and brothers when they tracked him down and tried to see him. And John 7:5 says "even his own brothers did not believe in him."
The gospels don't say how long this rift with his family lasted. But there must have been a reconciliation at some point, because Acts 1:14 says that Mary and all four brothers later joined the Nazarenes, the original community of believers in Jerusalem.
According to Luke 1:36, Mary was a relative of Elizabeth, the mother of John the Baptist. Luke 1:39-56 says that Mary went to live at Elizabeth's home in Judea after she became pregnant with Jesus and stayed there for about three months. Some scholars have suggested that Mary used Elizabeth's home as a refuge while waiting for Joseph to decide whether to accept her as his wife.
The oldest brother of Jesus was named James. He became a very important leader in the early church, and is the named author of the New Testament Epistle of James. Because he was very pious, and followed the Jewish religious laws very strictly, he was called James the Just (or James the Righteous). He was condemned to death and executed in Jerusalem in 62 AD.
Another brother of Jesus, called Jude (or Judas), is the named author of the New Testament Epistle of Jude.