If you are asking how long it takes for a particular drug to get out of your system for any reason other than passing a drug test, call your doctor or pharmacist for that information. If you are concerned about passing a drug test, following is the information you need.
If you are taking a drug that has been prescribed for you, all you have to do is take your prescription with you to the drug test and there should be no problem. If you are taking drugs other than those prescribed for you, the best thing we can do for you is encourage you to get any help you need to stop taking them as soon as possible.
For information and help, call The National Alcohol and Substance Abuse Information Center hotline at 1-800-784-6776 in the U.S. and 1-215-784-1120 outside the U.S. or visit the NASAIC site at: http://www.addictioncareoptions.com/
For more information about employment-related drug screenings, read: "Passing" Those Drug Screenings http://www.healthcentral.com/chronic-pain/c/5973/40834/screenings
Narcotics are fat soluable so it varies from person to person, but because it's fat soluable, a long time, and yes, it will show up in a urine screen. Just show your prescription bottle with your name and dosage on it and it should be no problem. I had a drug screen for a job interview and I'm on several narcotics for pain conditions and cancer. I brought my bottles and showed them to the screener, reported them on the form, and explained my medical condition to the interviewer. The ADA does not allow them to base a hiring decision based on medical condition and I was most qualified so I got the job. You really shouldn't have any problem unless you are taking the percocet illegally.