Drug addiction can take control of the brain and behavior, activating behavioral patterns that are directed excessively and compulsively toward drug usage. Such patterns often involve the development of repetitive and nearly automatic behaviors that we call habits. The striatum, a subcortical brain region important for proper motor function as well as for the formation of behavioral habits, is a major target for drugs of abuse. Here, we review recent studies of long-term synaptic plasticity in the striatum, emphasizing that drugs of abuse can exert pronounced influences on these processes, both in the striatum and in the dopaminergic midbrain. Synaptic plasticity in the ventral striatum appears to play a prominent role in early stages of drug use, whereas dopamine- and endocannabinoid-dependent synaptic plasticity in the dorsal striatum could contribute to the formation of persistent drug-related habits when casual drug use progresses towards compulsive drug use and addiction.