I've not seen an exact time restriction. My personal opinion is: If you are taking them regularly as prescribed, then give it at least 24 hours. If you are just taking them 1-2 times a day, then at least 8 hours. Another consideration is the tooth problem. If it is bothering you to the point that you need to take a narcotic for it, then it is a self grounding problem, because it is a significant distraction. When I do an operation on someone, I tell them if they are still taking narcotics they shouldn't be driving, because their reflexes(and attention to details) will not be up to snuff.
Also, some tooth problems get excrutiatingly worse with changes in altitude.
Barb(AME)