Possession of Dangerous Drugs in Arizona is a class 4 felony. If you were also caught with a pipe, you will likely be charged with possession of drug paraphernalia as well. The presumptive prison term for a class 4 felony is 2 years. It is not likely that you would go to prison on a first time offense; however, you could be incarcerated.
If you are interested in overcoming a drug addiction, you may have the opportunity to participate in drug court. In drug court you are giving counseling and an opportunity to stay out of jail if you test clean. Jail is used as an incentive to help you overcome your substance abuse problem.