I worked in a lab and we got this question all the time.
We were always told it COULD be up to 30 days.
Now there are many factors to this, it depends how much exposer, some people release toxic chemicals faster than others etc.
For example, if you smoked pot one day then did it 14 days later, your earlier date some may still be in your system when then you just added a new fresh amount.
Even being around it, such as second had can enter the body.
Here is the other glich, it all depends how much money the company wants to pay for the test.
If you are talking your normal lower cost employment test it is not as sensitive as others, now if someone (such as court cases) want to spend a lot of money they have test that can tell you what you have done in the last 3 years.