According to Matthew 1:18-25, Mary became pregnant with Jesus while she was engaged (but still unmarried) to Joseph. After Joseph found out about the pregnancy, he wanted to break off the engagement. 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 she apparently had some other children later. Evidence for this is found at Matthew 13:55-56 and Mark 6:3, which indicate that Jesus eventually had four brothers and at least two sisters. The names of his brothers are given as James, Joses, Simon, and Jude. Unfortunately, his sisters aren't named, and we don't even know how many there were.
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. 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. Apparently he 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 un-named 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 appear to have disapproved. According to Mark 3:21, they said that he was "out of his mind", and some of them attempted 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 who lived in Jerusalem after Jesus departed.
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, is the named author of the New Testament Epistle of Jude.
Note: For more on this subject, go to this article about the Secret Family of Jesus.