A telephone hook or switchhook is an electrical switch which indicates when the phone is hung up, often with a lever or magnetic button inside the cradle or base where a telephone handset resides. It takes its name from old wooden wall telephones and candlestick telephones, where the mouthpiece was mounted on the telephone box and, due to sidetone considerations, the receiver was separate, on a cable. When the telephone was not in use, the receiver was hung on a spring-loaded hook; its weight would cause the hook to swing down and open an electrical contact, disconnecting something, but not the telephone from the line or the phone could not ring. When the handset is on the cradle, the telephone is said to be "on-hook", or ready for a call. When the handset is off the cradle, the telephone is said to be "off-hook", or unable to receive any (further) calls.
Pushing the switchhook quickly is termed a "hook flash".
Telephone hook Wikipedia
"I tried calling you all day, but your phone must have been off the hook, because all I got was a busy signal."
A phone receiving many calls in rapid succession can be said to be "ringing off the hook". (Often cartoons will show a telephone handset literally bouncing above the ringing base unit.) This most likely led to the present use of "off the hook" as a synonym for "crazy" or "exciting". "Last night was off-the-hook" may mean "last night was really awesome".
"Off the hook", meaning "freed from responsibility or culpability" is not related to the telephone, but most likely derives from the image of a worm or fish dislodging itself from a fish hook.