Razelle is correct:
Hours building: No visa required as long as you hold a FAA license or conversion.
Flight training: A visa is required for any form of flight training that is towards a license, rating or certificate (even if you are not planning to take that license, rating or certificate in that trip).