(I left it too late to edit my post above, so I'll have to add another post, now, to offer another thought or two ...)
It's not really about "how many months" (though it may be partially about "how many trades").
You need to know that you can trade with a positive expectancy, before risking money.
It takes people different lengths of time to learn and prove that.
Probably, the more "discretionary" your trading, the longer you should be on demo for: a more rule-based and mechanical strategy may not need so much demo time.
Successful trading is all about risk-management, not profit-maximisation.
For this reason, what matters much more than the (for example, monthly percentage) return is the variability/steadiness of the return; in other words, its consistency is more important than its size. Someone making an average of 2-3% per month steadily over 6 months is far, far better placed to trade with real money than someone making an average of 5% profit over 6 months, which actually represents a mixture of monthly results between a high of 55% and a low of -45% (because the latter person's results are probably random, really.) And that's hugely relevant in determining how long you'll need a demo for.
The number of trades per month is also really important. (For example, a system which wins 85% of its trades but trades only twice a month is going to take far more testing, for the results to achieve statistical significance, than one which trades 8 times per day with a win-rate of 55%.)
In a sense, the question boils down to "How many results are needed for statistical significance?". The reality is that the correct answer depends on a whole range of factors, including some more subjective issues such as your degree of risk-aversion.