Off the cuff is an American English colloquial expression that came into use around 1940.
It was used to suggest that an actor or speaker was reading from notes written on his shirt sleeves rather than memorizing the words.
It's fairly common for students today to write notes on their hands or wrists. So if you were going to give a speech but hadn't actually prepared something and didn't have it written on paper, you might jot some hasty notes to yourself on your shirt cuffs. Then you were speaking "off the cuff" rather than from a prepared text.
Images of shirt cuffs:
Kate's explanation and example are perfect.
The study of the origin of words and phrases/expressions is called etymology.
Here is a great etymological website: http://www.etymonline.com/
To pull (someone's) leg is from 1882, perhaps talking about "playfully tripping someone", and pulling someone's leg also was described as a way to awaken a sleeping person in a railway compartment, ship's berth, etc.). The noun "pull" has also been described as "a jest" [a joke or trick] [just like Kate's example]