If somebody is convicted of a felony in Arizona and then they are charged again with a new felony, does that prior felony conviction affect the new case? The answer to that question is "it depends..."
As a general rule, a class 6, class 5, or class 4 felony counts as prior convictions for up to five years. A class 3, 2, or 1 felony can last up to 10 years. A dangerous crime conviction is a lifetime or "historical" prior and time spent in custody does not count towards the time period, whether the prior conviction was dangerous or nondangerous. The relevant dates are date of occurrence to date of occurrence. Also, a third "expired" felony counts too regardless of how old it is. In the parlance of Arizona criminal law, a felony that counts to enhance the sentence on a new charge is called a "historical" prior.
For example, if somebody commits a class 6 nondangerous felony on January 1, 2000 and is charged with a new crime committed on January 2, 2005, and the person did not do any jail time, they should be treated as a first offender. That prior conviction is non-historical. However, if that class 6 felony was dangerous then it would count as a prior conviction. Also under the first scenario, if the person did more than one day in jail, the first conviction would count as a historical prior because time spent in custody does not tick the felony clock.
This is important because prior convictions can enhance the penalty for new convictions. By way of example, a first conviction for a class to nondangerous felony the penalty can be anywhere from probation up to 12 ½ years in prison. But with one historical prior the sentence is a minimum of 4 ½ years in prison up to 23 ¼ years in prison. Someone with a historical prior is not eligible for probation on a new conviction.
Even though someone may be charged with a felony and have a historical prior conviction, that does not mean the prior will automatically apply to enhance a new sentence upon conviction. For one thing, the government must officially "allege" the prior, usually as an attachment to the indictment. And further, the government must "prove up" the prior upon conviction on the new charge. Sometimes, the government will even drop the allegation of a historical prior to motivate a person to plead guilty.
Finally, even if a prior conviction is too old to be alleged as a historical prior, the government can try to get around that by alleging under ARS 13-702.02(2) "Multiple offenses not committed on the same occasion": "(2) those that "were not committed on the same occasion" and "are not historical prior felony convictions as defined in section 13-604." See State v. Thompson, 200 Ariz. 439, 441 ¶ 9, 27 P.3d 796, 798 (2001). For a detailed exposition on the difference between ARS 13-702.02 "multiple offenses" and ARS 13-604 "sentencing enhancements" see State v. Hauser.