You'll have to undergo a urinalysis test within 72 hours of arrival at Air Force Basic Military Training (AFBMT). Generally this test is done on the day after your arrival.
It takes about two to three weeks for the basic training command to get the results back. If you fail the urinalysis test, you will be immediately transfered to the transition flight, where you will do scut-work for a couple of weeks while the Air Force processes your discharge. There are NO exceptions to this rule. The Air Force has a zero-tolerance policy for illegal drug abuse. If you fail this test in basic training you will be discharged, and you will never, ever, be allowed to re-join the Air Force, the Air Force Reserves, or the Air National Guard in the future.
You might be able to join one of the other branchs (except the Coast Guard), if they grant you a waiver, and after a mandatory waiting period (ranging from six months to two years, depending on the service).
Want to Know More About Air Force Basic Training?