You may take the AFOQT twice. However, your most recent test score is the one that counts. In rare circumstances you may obtain a waiver to take the AFOQT more than two times.
Note: If you take the AFOQT and your scores just meet the minimum requirements*: P50/N50/Q50/V50/AA50, you might consider ensuring the rest of your package (e.g., letters of recommendation, resume, personal statement, interview, gpa) is superb rather than waiting to re-test and possibly scoring worse than you did the first time.
Develop A Study Regimen That Works For You.
Have a look at this sample six week study schedule.