You can take the ASTB at any point, starting your freshman year. You are able to take it three times total, and only your most recent score counts. If you want to secure an aviation guarantee, I'd recommend earning qualifying scores no later than the fall semester of your junior year, due to the lengthy flight physical process.