The stock market can be daunting at times, and the roller coaster of ups and downs is often tough for even experienced investors to stomach.

However, the market is also a wealth-building powerhouse, and even small amounts of cash invested in the right stocks on a regular basis can grow into a portfolio worth hundreds of thousands of dollars over time.

While you don't need a lot of cash to get started in the stock market, you will need the right strategy. Here's exactly what it takes to turn just $50 per week into $497,000 or more.

Person writing in a notebook and looking at a laptop.

Image source: Getty Images.

Time is your greatest ally

Compound growth is the key to generating life-changing wealth in the stock market. As you accrue growth and earn returns on your investments over time, you begin to earn additional returns on your previous gains as well -- not just on the money you originally invested. The longer you leave your money to grow and compound, the faster your portfolio can grow.

Because of that, you should get started investing as soon as possible. The more time you have to let the power of compounding do its work, the less of your own money you'll need to invest each month to wind up with a significant nest egg.

If you're off to a late start or can't afford to invest much right now, don't fret. Every single year counts, and it's far better to invest even a little now than to put off getting started. You can always increase your contribution rate later, but you can't get this time back.

Choosing the right investments

It's equally important to ensure you're investing in the right places, because the stocks or funds you choose will make or break your portfolio. Put your money into shaky speculative companies or assets, and you could lose more than you gain.

If you're investing in individual stocks, focus on buying quality companies with solid underlying business fundamentals. These fundamentals can include everything from durable competitive advantages to healthy financials to competent leadership teams that can reliably guide companies through both good and bad times.

Individual stocks aren't the only way to invest, however. If you're looking for a simple, no-fuss investment that requires next to no effort, you may opt for an S&P 500 index fund or ETF. These funds track the S&P 500 index, so they are invested in 500 of the largest public U.S. companies.

S&P 500 index funds are generally considered among the safest funds you can buy. The index has a long history of recovering from downturns and following them with new highs. S&P 500 funds also provide instant diversification to limit the risk any individual company's prospects can pose to your returns, and the companies within it are juggernauts, making them more likely to see consistent growth over time.

Building a $497,000 portfolio

Regardless of where you choose to invest, time and consistency are keys to a successful investing strategy.

Let's say you're investing in an S&P 500 index fund that on average, over the long term, delivers a 10% annual rate of return -- in line with the market's historic average. If you invest $50 per week, here's approximately how much you could accumulate over time:

Number of Years Total Portfolio Value
20 $167,000
25 $291,000
30 $497,000
35 $836,000
40 $1,395,000

Data source: Author's calculations via savingscalculator.org.

To reach a total portfolio value of $497,000, you'd need to invest consistently for around 30 years. But if you have even a few more years to let your money grow, you could earn hundreds of thousands of dollars more -- or potentially even pass the $1 million mark.

Keep in mind that these figures are based on the assumption that you're earning average returns in line with the market's historic performance. If you're investing in individual stocks, you could potentially reap returns that are well above average.

If you were to earn, say, a 12% average annual return, your portfolio would be worth roughly $772,000 after 30 years, all other factors remaining the same. Just double-check that you're investing in healthy companies, which will limit your risk while still maximizing your long-term earnings potential.

It takes time and patience to build a portfolio worth hundreds of thousands of dollars, but it's more attainable than it might seem. By choosing the right stocks, investing consistently, and giving your money as much time as possible to grow, you can put yourself on the road to building life-changing wealth in the stock market.