Historically, the list of Shakespeare’s play which appeared in 1598 doesn’t include the Twelfth Night. It was referred to by John Manningham in 1602 so it was perhaps composed between these years.
Other historical evidence suggests that it was presented to Queen Elizabeth on Twelfth Night in 1601 and her guest of honor was an Italian nobleman called Virginio Orsino. Probably the character of Duke was named to honor him. So, these facts tell us about the historical ambiguity around the title of the play.
In a literal sense, ‘Twelfth Night’ is the night preceding the Christian feast of the Epiphany which occurs on January 6th. In earlier times, Christians used to celebrate the Christmas festival for twelve days.
They used to celebrate it with great merriment and show. Before Christianity, the same ritual was celebrated according to nature because it was the time of the year when cold used to end and season used to become warmer.
The dimness of winter used to change into the light. Keeping the historical and religious facts in mind, one can understand the significance of the play’s title.
In the play, one sees the suggestions to celebrate throughout its comic subplot. Both Sir Toby and Sir Andrew are in celebratory mode always. Maria accuses them of being “drunk nightly.”
When Malvolio tries to correct them, Sir Toby says, “Dost thou think, because of thou art virtuous, there shall be no more cakes and ale?” All this hints at us about the festive mode of the play. Again and again, the characters in the play say, let’s have a song, let’s have wine.
Apart from the celebration, the title festival used to have role plays where masters and servants used to come together too without any social boundary. Shakespeare utilizes the whole device of role-playing in another way by putting it into gender roles.
Viola changes herself into Cesario and attracts an upper-class ruling woman Olivia into love. The whole device breaks the social boundary which was legit when Orsino was expressing his love to Olivia as a Duke. Just like the literal celebration of Twelfth Night, the play also sometimes suspends the social rules.
The play has an alternative title too which says, “what you will.” The secondary relevance of the first title tells us probably to not take it seriously. ‘What you will’ suggests perhaps the way unreal wishes come true in the play.
So, the title of the play doesn’t relate as directly as other plays of Shakespeare but there are alternate significances that go deeper than what it may look like.