It depends. Fast-acting opioids like heroin work almost immediately. Oral painkillers like Vicodin can take about an hour to work.