It has been linked to the fact there were 13 people at the last supper of Jesus Christ, but it probably originated only in medieval times. It has also been linked to that fact that a lunisolar calendar must have 13 months in some years, while the solar Gregorian calendar and lunar Islamic calendar always have 12 months in a year.
Some buildings number their floors so as to skip floor 13 entirely, jumping from floor 12 to floor 14 in order to avoid distressing triskaidekaphobics, or using 12a and 12b instead.
One famous figure to have suffered from triskaidekaphobia was the composer Arnold Schoenberg. He was born and died on the 13th of the month.