The man behind the word later decided that the trance was not really sleep. The sleepy name stuck anyway.
In Greek myth, Hypnos was sleep itself in the form of a god. Hesiod makes him a son of Nyx, Night, and a brother of Thanatos, Death. In the Iliad, Hera talks him into putting Zeus to sleep so she can work behind his back. The Romans called him Somnus. His name was also simply the Greek word for sleep.
The modern word starts with a Scottish surgeon in Manchester. On 13 November 1841, James Braid went to a public show of "animal magnetism," or mesmerism, by Charles Lafontaine. Mesmerists credited the effects to a magnetic force. Braid concluded instead that the effects came from the subject's own concentrated attention.
He wanted a name that did not carry the mesmerists' baggage. In a lecture on 12 March 1842 he said it was "desirable to assume another name" for the phenomena. He called the state "nervous sleep," using sleep only as a metaphor. The word "nervous" marked it off from ordinary sleep. From Greek hypnos he made neuro-hypnotism, soon shortened to hypnotism, and the verb hypnotize. His 1843 book Neurypnology set out the theory.
Strictly, Braid did not coin hypnosis. Etymonline records it in 1850 as an alternative to hypnotism, meaning "the coming on of sleep." By 1876 it was being used for the induced trance. Wikipedia's biography of Braid says he never used the word, and credits it to the Nancy School of the 1880s.
Braid himself kept moving away from the sleep idea. By 1855 he was writing of a "mono-ideo-dynamic" principle, in which a single dominant idea drives the body's movements without conscious will. A proposal to call the practice "Braidism" was meant as a jab, and he rejected it.
Hypnos also has distant relatives in Latin. Both hypnos and Latin somnus are traced to an ancient root, swep-, meaning sleep.