Alternator or its wiring have intermittent "issues". Also, check the belt, first. Make sure the tension is good. If the battery light comes on at higher rpm, might be floating brushes in the alternator.