Nightcap (garment)
A nightcap is a cloth cap worn with other nightwear such as pajamas, a onesie, a nightshirt or a nightgown. They are somewhat similar to winter beanies worn in cold climates of Northern Europe.

Design 
Women's night caps usually consist of a long piece of cloth wrapped around the head. Men's nightcaps are traditionally pointed, with a long top, sometimes accompanied by a small ball of some sort, which is used similar to a scarf. It keeps at least the back of the neck warm while not being so long that it could wrap around and become a strangulation hazard.

History 
Nightcaps were frequently worn in the British Isles and Scandinavia before central heating was available, as temperatures would fluctuate frequently in the winter months. However, nightcaps are worn all year round.

In the Tyburn and Newgate days of British judicial hanging history, the hood used to cover the prisoner's face was actually a nightcap supplied by the prisoner himself, if he could afford it.  When he had finished his prayers, the hangman simply pulled it down over his face. In some cases, women might choose a bonnet with a veil instead. From around 1850 a white linen hood was provided by the authorities as part of the execution process. 

Nightcaps are less commonly worn in modern times, but are often featured in animation and other media, as part of a character's nightwear. Occasionally worn in the 20th and 21st centuries as well, it has become associated with the fictional sleeper Ebenezer Scrooge. Because of the hat's popular association with Ebenezer Scrooge's bedtime wardrobe, it has become typical nightwear for a sleeper especially in comical drawings or cartoons along with children's stories, plays, and films; for example, in several Lupin III animations Daisuke Jigen has worn one as a continuation of the "hat covering eyes" gag, and in The Science of Discworld Rincewind has one with the word "Wizzard" stitched onto it.

See also 
Barretina
Phrygian cap
Tuque
Coif
Cap

References

Headgear
Nightwear