I think that the 5% idea comes from active trading theory where the idea is that you take lots of small bets but never risk more than 5% on any one bet.
As most here have said, we tend to focus on diversifying by having mutual funds that are split according to an appropriate asset allocation strategy.
For example, some percent in bond funds and some percent in stock funds. Within bonds some in government, some in corporate, some maybe in foreign government. Within stocks, some in US, some in foreign, smaller amount in emerging markets, some split between growth and value or large cap and small cap.
Here you would figure out the appropriate percentages by reading a book like The Four Pillars of Investing. 5% in each would not be correct, but the exact split depends on your individual situation.
If you would like to read more about active trading with a bent toward gambling and gaming theory you can read Trade Your Way to Financial Freedom by Van Tharp. He covers the math associated with this strategy pretty well. Keep in mind that this is a totally different mind set from the long term investment methods.