I want to know how long 麻醉 and 麻药 have been compounded to mean anesthesia and anesthetic respectively. What is the approximate date of the origin of those two Chinese words? Are their origins relatively recent or relatively remote? Is there a reference site online that has this information or a reference in book form?
I assume you're looking for how Chinese translated the technical terms, which according to the OED were invented by Oliver Wendell Holmes in 1846.
Chinese has early claims for anesthetic compounds a couple of thousand years before this, going back to the hoary Hua Tuo. Wikipedia's article on the history of general anesthesia has a few things about him. There is more in the article on the Japanese doctor Hanaoka Seishū, reputedly the first person to perform an operation using general anesthesia.
Both of these articles represent Wikipedia at its least reliable (look at the references), and in any case are not about the medical practices which Holmes christened in the 19th century.
As the comment from 倪阔乐 above mentions, the word ma-yao appears in Shui-hu-chuan (late 16th cent.) as a name for a general type of drug that is probably something like knock-out drops.
Shui-hu-chuan calls the ma-yao in question 蒙汗藥 meng-han-yao, a drug which also appears in plays from the Yuan dynasty (13th cent). People who get dosed with 蒙汗藥 usually wind up as steamed meat buns in shops run by people you would not like to meet in a dark alley. Despite the claims of various dictionaries, I would not call this an anesthetic.
I would say that this is a difficult question, not an easy one. You will have to hunt around in early accounts for yourself, and this could be tough. The book Anesthesia: Essays on its history has a chapter by S. Yong called "History of Modern Anesthesia in China". Alas, it's only 3 pages long. Clearly there's a lot to be done.
Hua Tuo's (c. 140–208)innovative anaesthetic mafeisan 麻沸散 "cannabis boiling powder" is a long-standing mystery. https://en.wikipedia.org/wiki/Hua_Tuo
麻沸散 claimed to be the first sort of anaesthetic, probably combined with surgical analgesia by acupuncture when in surgical practice.
Even the mystery lasts long, I would say neither the 麻醉 or 麻药 is a recent concept.