The answer you seek is in ATF 5320.8 Chapter 2 and Title 27 § 479.11
Essentially, adding a vertical foregrip to a pistol, according to the ATF changes the pistol to an AOW. (Pistols are designed to be fired by one hand. Adding a vertical foregrip changes that to a two handed firearm.)
If the OAL of the firearm is greater than 26" then it is not an AOW, but merely a firearm. You MAY add a Vertical foregrip to a fiream greater than 26" in length without creating an NFA firearm.
You may make an AOW, if you wish. It's the same process as making an SBR and in fact the same cost as making an SBR. You fill out a 5320.1 (Form 1) and send it to the ATF, wait 6 months for it to come back, and you add your vertical foregrip.
Most folks who do this, just end up putting a stock on it and making them into SBR's. You can remove the stock any time you want to go to the two handed AOW, but you have the option of adding a stock to it as well.