The claim comes from General S. L. A. Marshall's 1947 book Men Against Fire: The Problem of Battle Command in Future War. During the war, Marshall conducted post-action interviews (hours or days later) with American soldiers in the Pacific and European theaters. On the basis of these interviews, Marshall concluded that only about one quarter of infantrymen in combat in WWII ever actually fired their weapons.
Marshall's techniques were essentially Anthropological/ethnographic, which makes his quantitative conclusion questionable (as this article makes clear). But it does seem that he demonstrated that at least a significant fraction of soldiers were not firing their weapons. He applied the same ethnographic technique later during the Korean war and concluded that a much higher percentage of soldiers were firing their weapons.
The phenomenon of soldiers not actually firing their guns in combat may have been somewhat widespread. Poilu by French infantryman Louis Barthas is a very rare account by a non-officer of WWI soldiering. As an avowed socialist, Barthas refused on principal to fire his rifle at the enemy, and encouraged soldiers in his company to do the same. His war consisted of marching in and out of the trenches and being shelled (including a horrifying stretch at Verdun), so his decision never to shoot had no practical effect.