Hang as in to spend time or relax, is American teen slang from the late 1950s. To 'get the hang of something' is also American from c. 1834 meaning to become proficient, presumably with some tool or other, but the exact origin is obscure. It certainly has nothing to do with with hanging as in an execution, whereas 'hang it', an oath or imprecation, most cerainly does. 'Hang it' dates from the 1400s where one wishes that something, whatever it may be, be hanged. 'To hang back' meaning not to proceed swiftly, dates from the late 1500s. 'To hang a jury', i.e. to prevent a jury from coming to a unanimous decision, hence a 'hung jury', is originally American and dates from the mid-19th century.