I buy the upgrades when I start to get more cookies then what the upgrade costs. So if an upgrade cost 1 million cookies I waited till I kept getting influxes of 1 million.
I'm at 9.5m cookies a second
Those 5% cookie upgrades aren't worth it till you gotten the better stuff.