Americans place their hands over their hearts during the national anthem because it is the customary salute to the flag and anthem suggested by the country's flag code. The flag code was codified into law by Congress in December 1942. That law suggested using the Bellamy salute, in which people saluted the flag with their arms straight out and palms up. However, the salutes used by the Nazis and Fascists resembled the Bellamy salute, so Congress made the change.
SOURCE