Marijuana will stay in your system the longest of any intoxicant that can be tested, and will require the longest period of detoxification. Many products exist on the market that claim to wipe urine clean of the detection, I would be weary of the results as it depends greatly on the time between consumption and the test taking place. Everyone’s metabolism is different, and level of overall health and ability to clear the body of any and all toxins will depend on one’s liver function and level of exercise (which keeps these systems functioning optimally). Some studies estimate that a typical, frequent marijuana user will have evidence of it in his or her system for about three weeks. So, erring on the extreme side of caution, it’s probably best to refrain from smoking pot three months prior to testing to be completely certain.
This would depend on your metabolism and would likely be similar to inhaled cannabis. If you are a regular user THC can be detected in the hair follicles for months after last use.