While it is a crime to use certain drugs or to use prescription drugs
in a way not prescribed by your doctor, what about over-the-counter
drugs?
Most (but not all) prescription drugs are controlled substances. Controlled substances that are not Schedule I controlled substances under the federal controlled substances act may be prescribed by a doctor in accordance with state regulated medical standards (including prescriptions for "off label" uses of a prescription drug contrary to its FDA authorized uses).
Also, most, but not all, states have controlled substances laws that track the federal controlled substances laws closely, although not necessarily exactly. A state can decline to treat a federally controlled substance as a controlled substance for state law purposes, and can likewise decide to classify a drug as a controlled substance for state law purposes even though federal law does not do so. A state can also define controlled substances offenses differently.
But all of these deviations from the federal controlled substances act tend to be rare exceptions in state statutes that track the federal law with only a handful of exceptions and with whatever modifications are necessary to fit into the state's classification of different grades of felony and misdemeanor offenses.
Using a prescription drug prescribed for someone else (or possessing a prescription drug prescribed for someone else for use by someone other than the person for whom it is prescribed) without a prescription is a controlled substances crime, although mere possession of a prescription drug prescribed for someone else in order to make the prescribed drug available to the person for whom it is prescribed would generally not be.
Arguably, it is a controlled substances crime to use a prescription drug for a condition other than the one for which it is prescribed after the condition for which it is prescribed ceases in cases where the prescribed condition does not recur.
For example, if you are prescribed codeine (a weak opiate) for a severe cough, and after the cough has ended while you are healthy, you use the prescribed codeine for recreational use, that might be a controlled substance offense. (I'm not an expert and haven't researched that question now since it is only tangential to the question asked.)
But simply using a drug prescribed for you in a manner other than the exact manner it is prescribed to be used to treat the condition for which the drug is prescribed is not a controlled substances offense.
If, for example, the instructions of an over-the-counter drug say you
should take it once every six hours, but due to circumstances on a
certain day, you decide to take it an hour early (five hours), would
you have committed a crime?
No. It is not a crime.
But, using an over-the-counter drug contrary to the instructions on its use is not entirely without legal consequences.
If you use an over-the-counter drug in a manner contrary to the instruction on its use and suffer injury or illness as a result of doing so, the manufacturer and seller of the over-the-counter drug can use this fact as a defense to a product liability lawsuit from the person who used the over-the-counter drug improperly and suffered ill effects as a result.