It is illegal to be in possession of heroin and also to manufacture and distribute it. It is classified as a Schedule 1 Drug in the United States. Schedule 1 drugs are those that are the most addicting and have no medicinal value or use, at least not in the United States. Heroin can be used to treat pain. Many opiates are used for this purpose. This would seemingly knock it off of the Schedule 1 list. However, it doesn’t. Perhaps because it is not used for this purpose in the United States, this fact doesn’t matter. Other drugs on the Schedule 1 list include heroin, marijuana, LSD, PCP, and crack cocaine (this isn’t exhaustive).
Heroin is not completely illegal in some countries. For example, in the Netherlands it can be prescribed by doctors for heroin addicts after other forms of treatment, namely the use of methadone, have failed. As mentioned above, it is illegal in the United States for individuals to be in possession of it who have no DEA (Drug Enforcement Agency) license.
In the United States, persons found with greater than 100 g of heroin or heroin substance (heroin mixed with something else) will face a minimum sentence of five years in prison and perhaps even more. In most countries heroin is illegal to use or possess by persons who have not been prescribed it for some medical purposes including drug rehabilitation. Those who are found with heroin without the proper licensing and permissions may face jail time. In the United States if a certain amount is found on a person without a DEA license then they are subject to automatic sentencing.
Heroin does have medical uses although most of them are not recognized or utilized in the U.S. This is largely why it is on the Schedule 1 list of drugs. Heroin is an opiate and can be used as a pain reliever and may even be used to help addicts get off of heroin. It may be utilized as part of a dose-down program where individuals get decreasing amounts of the drug so that they can avoid going turkey and experiencing the distressing withdrawal symptoms that accompany it. Because neither of these uses are widespread in the United States heroin essentially has no medicinal value in the U.S. and is essentially illegal for almost all purposes.