Smoking hats and jackets were popular in the Victorian and Edwardian eras, and were intended to be worn while smoking in order to keep smoke out of one's hair and off of one's formal jacket. After dinner, it was often the practice for the men to retire to the smoking room for cigars/pipes and brandy, while women would retire to the parlor for conversation, music, etc. Once the evening came to a close, the men could remove their smoking jackets and hats, and be less likely to offend the delicate nasal passages of their wives.
The smoking cap is based on the Tarboosh, a round hat worn in many areas of the Middle East and Africa - taller versions became the Fez, invented in Morocco and part of the dress code in the Ottoman Empire at various times. In the Ottoman Empire, the classic red/burgundy color was restricted to Muslim males, whereas Christian or Jewish men could wear black or dark blue. The smoking jacket is based on earlier dressing gowns, shortened up and made out of Asian silks and velvet. They remained popular until relatively recently, though there's been a slight uptick in sales lately (along with waistcoats and bow ties).
For my own Steampunk costuming needs, I've got several amusing fezzes (both tall and smoking cap style) from Fez-O-Rama, but since I do the bulk of my pipe smoking outdoors, my smoking jacket is actually a military surplus M-65 field jacket, and I've only recently acquired a proper fedora. :wink: