The fear of Friday the 13th stems from two separate fears -- the fear of the number 13 and the fear of Fridays. Both fears have deep roots in Western culture, most notably in Christian theology.
Thirteen is significant to Christians because it is the number of people who were present at the Last Supper (Jesus and his 12 apostles). Judas, the apostle who betrayed Jesus, was the 13th member of the party to arrive.
Christians have traditionally been wary of Fridays because Jesus was crucified on a Friday. Additionally, some theologians hold that Adam and Eve ate from the forbidden fruit on a Friday, and that the Great Flood began on a Friday. In the past, many Christians would never begin any new project or trip on a Friday, fearing they would be doomed from the start.
Sailors were particularly superstitious in this regard, often refusing to ship out on a Friday. According to unverified legend (very likely untrue), the British Navy commissioned a ship in the 1800s called H.M.S. Friday, in order to quell the superstition. The navy selected the crew on a Friday, launched the ship on a Friday and even selected a man named James Friday as the ship's captain. Then, one Friday morning, the ship set off on its maiden voyage... and disappeared forever. A similar, entirely factual story is the harrowing flight of Apollo 13.
Some historians suggest the Christian distrust of Fridays is actually linked to the early Catholic Church's overall suppression of pagan religions and women. In the Roman calendar, Friday was devoted to Venus, the goddess of love. When Norsemen adapted the calendar, they named the day after Frigg, or Freya, Norse goddesses connected to love and sex. Both of these strong female figures once posed a threat to male-dominated Christianity, the theory goes, so the Christian church vilified the day named after them.
This characterization may also have played a part in the fear of the number 13. It was said that Frigg would often join a coven of witches, normally a group of 12, bringing the total to 13. This idea may have originated with the Christian Church itself; it's impossible to verify the exact origins of most folklore. A similar Christian legend holds that 13 is unholy because it signifies the gathering of 12 witches and the devil.
The number 13 could also have been considered pagan because there are 13 months in the pagan lunar calendar. The lunar calendar also corresponds to the human menstrual cycle, connecting the number to femininity.