It's a piece of music that Mendelssohn composed in 1843 as incidental music to accompany a production of Shakespeare's play. The "Wedding March" is specifically meant to be played during the wedding of Theseus and Hippolyta.
While not part of Shakespeare's original play, it's become so iconic that it's now commonly associated with weddings and is often played at those events.