My definition is based on years of home poker tournaments and cash games, as a player and a host.
A general rule is that you don't have more than one instance of a chip being 2x the previous chip (500/1000 acceptable, but nowhere else). A second general rule is each chip is 4x to 5x the prior chip, so no 10/25 type chips. Breaking either of these rules really fouls it up.
Tournaments (chips in play per player, not in set)
Note: I used 300 BB as a standard. If using less than 300 BB, use fewer large chips, but not more small chips. If using more than 300 BB, use more large chips.
1 -- 10 is optimal; 15 might be OK, more is too many
5 -- 8-13 is optimal
25 -- 9-13 is optimal
100 -- 1-3 is optimal
500 -- color up
1000 -- color up
5 --10 is optimal; 15 might be OK, more is too many
25 -- 10 -14 is optimal
100 -- 10 - 12 is optimal
500 -- 3
1000 -- color up
5000 -- color up
My tournament sets start with 25 as the lowest; blinds start at either 25/50 or 50/100. For this I used 50/100. I also have no problem with 5 starting denoms as long as chips are denominated. I've even used 6 without issue.
25 - 12 is optimal
100 - 12 is optimal
500 -- 3-5 is optimal
1000 -- 7-11 is optimal
5000 -- 3-4 is optimal
25,000 -- color up
Generally for tournaments:
Lowest denom -- 8 or fewer is not enough; 10-12 is optimal; over 15 is too much.
2nd lowest -- about the same, depending somewhat on colorup philosophy. Same if you plan to either use the 2nd lowest to completely colorup the lowest or if you ever intend to make the 2nd lowest the lowest for a more flexible set or playing with higher numbers.
3rd lowest -- if you started at 25, then this is your 500. You need way fewer of these -- some people use way too many. 3-5 per player is enough if you are using 1000.
4th lowest -- about 2x the 3rd lowest
Cash
10 to 20 per denom until you get to the one where the next logical denom is 2x the previous. Having too many of one can easily lead to mistakes, especially the later it is, and the more people have had to drink.
Cash is harder to determine, but following general tournament concepts seems to work well. A lot of people overload on smaller chips and have too few of the higher values. If you max buy-in is $20 or $25, you could get by that as your highest value chip; otherwise you need at least some $100 chips.
Overall
I don't think there is a perfect formula, but having played with many, what I've said here works better than formats outside of these guidelines.