Welcome to the forum from Tucson.
I used to keep up with the laws but I have not in a long time. Arizona follows the federal law of motorized bicycle which is basically 48cc or under, 20 mph and under and you are good to go.
But many cities up North of Tucson adopt their own city ordinance for motorized bicycles.
From the quick search I did I believe Gilbert uses the moped law, but don't take my word on it. You will have to do your own research or hopefully someone on the forum knows the laws.
Here is the only info I found https://www.gilbertaz.gov/home/showdocument?id=2734