"Twelfth Night is a comedy by William Shakespeare, named after the Twelfth Night holiday of the Christmas season. It was written around 1601, and was first published in the First Folio in 1623.
Twelfth Night's full title is Twelfth Night, or What You Will; Subtitles for plays were fashionable in the Elizabethan period, though this is the only Shakespeare to be donned with one. "Twelfth Night" is a reference to the twelfth night after Christmas Day which was called the Feast of Epiphany. It was originally a Catholic holiday, but prior to Shakespeare's play, the day had become a day of revelry. Servants often dressed up as their masters, men like women, and so forth. This is an important basis for the shenanigans of the play.
The play was probably finished between 1600 and 1601. The name of its male lead, Orsino, was likely suggested by Orsini, Duke of Bracciano, an Italian nobleman who visited London in the winter of 1600 to 1601.
The play was not printed until its inclusion in the First Folio in 1623."