Given all the market uncertainty this year and the downward trend of the major indices, it's no surprise that some investors are hesitant to buy right now. Knowing the right time to pull the trigger on a stock purchase (or a sale) is often one of the hardest parts of being an investor.

What long-term investors should remember is that when you buy (or sell) is far less important than what you buy. If you are buying with the idea of holding the stock long-term, buying now or waiting until next year becomes much less important than making sure you pick a quality company. Still, this current market situation has created some buying opportunities at the moment that might not be as opportunistic next year if a market recovery takes hold.

Three such buy-now opportunities are Vertex Pharmaceuticals (VRTX -0.59%)Mattel (MAT 0.77%), and Nvidia (NVDA -0.49%). All three are solid businesses with attractive growth prospects that can make them ideal buy-and-hold stocks. Let's take a closer look at their operations and see why these might be good investments to load up on right now.

1. Vertex Pharmaceuticals

Vertex Pharmaceuticals has been a beast this year, achieving impressive sales growth that's likely to continue into next year, even if the economy slows further. That's because the company has some fast-growing products related to the treatment of cystic fibrosis (CF) that help this business outperform the broader market.

In the third quarter, the company's product revenue of $2.3 billion was up 18% year over year, led by top-selling CF product Trikafta/Kaftrio, which brought in over $2 billion in sales on its own. Net income of $931 million was also up 9% year over year.

But Vertex has more than CF in its portfolio as the company collaborates with CRISPR Therapeutics. The two companies are working to get final approval of a gene-therapy treatment called exa-cel, which can be used to treat sickle cell disease and beta thalassemia, a rare blood disorder. If approved, exa-cel has the potential to add billions in additional revenue. The companies expect that, by early next year, their rolling submission package to the Food and Drug Administration (FDA) for the biologics licensing application for exa-cel will be complete.

At a forward price-to-earnings (P/E) multiple of 20, based on analyst expectations, Vertex trades a little higher than the average healthcare stock, which investors are paying 17 times future profits for. But given that its growth story looks nowhere near over, Vertex is still a great buy today heading into 2023 and beyond.

2. Mattel

Toymaker Mattel has an impressive portfolio of billion-dollar toy brands that include Hot Wheels, Fisher-Price, and Barbie. The brands have been around for decades, and their popularity levels are unlikely to change anytime soon. The release of a Barbie live-action movie in 2023 is likely to provide a solid boost to the brand and some strong growth for Mattel.

Mattel's sales have proven to be resilient this year as net revenue of more than $4 billion through the first nine months is up 10% year over year, and that increases to 13% when factoring out the impact of foreign currency exchange rates. Although rising costs have been a problem for many companies, Mattel's operating profit of nearly $600 million is up 26% this year.

With a robust business that's in solid shape today, it's hard not to like Mattel's stock, especially at its current valuation; down 16%, the stock trades at a forward P/E of only 10.

3. Nvidia

Shares of chipmaker Nvidia are down more than 45% this year as it has not been immune from the tech sell-off in 2022. The growth company is struggling of late as sales in its most recent quarter (for the period ending Oct. 30) totaled just $5.9 billion and were down 17% year over year. And for next quarter, revenue is only forecast to come in a bit higher at $6 billion.

Weak demand in the PC market, the downturn in the cryptocurrency markets, and restrictions on chip sales to the Chinese market are a couple of reasons why investors aren't bullish on the stock of late. The Chinese market as a whole isn't strong right now due to COVID-19-related lockdowns.

But these problems aren't long-term issues and over time should resolve. Buying amid pessimism and a reduced price could make now an opportune time to add Nvidia to your portfolio. Nvidia remains a top company in the chip world, and the softer results have made it look like a worse buy, trading at more than 70 times profits. But on a forward basis, the P/E multiple is at 39.

Admittedly, these valuations aren't all that cheap, but the stock is down close to 52% from its 52-week high. And with more growth still ahead for the business in an increasingly connected world, this could still be a solid stock to buy for the long haul. In fact, shares of Nvidia have already started to take off on better-than-expected economic data released in November.