This is kind of a bullshit answer, but "as many as it takes".
I think I have 4-5 forma on some weapons^1^, but I haven't done more than 2-3 on a frame. Some frames don't need any at all to fit the build I want.
^1^ Excluding tenet/kuva weapons, those I always put in 5 since it's required to get the XP out of them. I often find myself debating what to do with that last forma needed, since at that point the build is rather tight.
I think the need for more forma for frames probably comes with umbral builds, since umbra forma is scarce and the mods still use a ton of drain even with matching umbra polarities.
For weapons it's just "put in V polarity until it fits", haha.