Marijuana would be at least one week.
With regard to the active ingredient of vicodin, hydrocodone, my guess is that it would be several days.
Codeine (very similar to hydrocodone in structure) has about 10% converted to morphine. Morphine when metabolized is conjugated (chemically combined) with other things then undergoes what is called enterohepatic circulation.
Enterohepatic circulation is where a substance is secreted into the bile and then the bile expells its contents into the intestine, the intestine then absorbs the substance back into the body.
A fraction of the substance not excreted back into the bile goes into the urine. I would be very surprised if hydrocodone metabolites did not undergo this enterohepatic circulation.
Source(s):
Goodman and Gillman's Pharmacological Basis of Therapeutics, 6th edition, pages 506-507.