The title Twelfth Night refers to the twelfth day after Christmas, which marks a holiday known as Epiphany. Epiphany celebrates the arrival of the Magi, or Three Wise Men, to deliver their gifts to baby Jesus. While one might expect an Epiphany celebration to be much like the rest of Christmas festivities, apparently in Shakespeare's day the celebrations were known to be quite wild. Shakespeare in particular wrote the play in 1602 for a festivity held at one of the Inns of Court, and that particular festivity was known to be "absolutely secular and even quite bawdy," meaning having absolutely nothing to do with religion and even very obscene ("Shakespeare's Twelfth Night"). Epiphany celebrations were also known to be "a time of masques, revels, defiance of authority, and general foolishness" ("Shakespeare's Twelfth Night"). Epiphany has also been described as a "time when excess and license were expected to run rampant ... a time of merry-making, of hard drinking, and of romantic (or lusty) pursuits" (eNotes, "Twelfth Night: Themes"). We can see exactly how Shakespeare's play portrays all of the above descriptions of Epiphany, making Twelfth Night, especially the play's subtitle, Or What You Will, the perfect title for the play written for an Epiphany party.
The play's secular and bawdy themes are mostly portrayed through the antics of Maria, Sirs Toby and Andrew, and Fabian. In particular, their treatment of Malvolio can be seen as bawdy, or obscene, meaning "offensive to morality or decency" (Random House Dictionary). While Maria's letter tricking Malvolio into believing Olivia is in love with him may have been amusing, capturing the merriness of Epiphany, Sir Toby crosses the line when he decides to have Malvolio locked up in total darkness as a madman. Locking him in complete darkness can of course be seen as a form of torture and is quite cruel. The hard drinking characteristic of the night is also seen in Sir Toby's behavior, especially the drinking revelry he and Sir Andrew have late one night in the house in Act 2, Scene 3.
In addition, the masquerading that is a frequent part of an Epiphany celebration is of course captured in Viola's plan to disguise herself as a boy, which also runs contrary to social norms, capturing theme of "defiance of authority." Finally, we also have the love triangles in the play, which capture the theme of romance or lust.