You have to get it here before you leave, otherwise you have to apply H-1B to come back. By the way, it is unlikely that you can get your AP in such a short time.