With the S&P 500 index recently hitting a new all-time high, we can officially declare that we are in a bull market. While that's exciting news, it doesn't change the blueprint of success for long-term investors. The plan remains to pick out stocks to hold on to for a while, stocks that can perform well in good times and stay in one piece during bad times.

For investors in search of such companies, let's consider two excellent candidates: Merck (MRK 0.37%) and Fiverr (FVRR 3.74%). Read on to find out why these corporations could deliver superior returns in the next 10 years.

1. Merck

Merck has relied on Keytruda to drive sales growth for a while. Keytruda has earned dozens of indications in treating various cancers around the world. The medicine became the best-selling drug in the world in 2023, an honor it should keep for a few more years. Unfortunately, Keytruda will run out of patent protection in 2028.

Can Merck survive this ordeal and continue delivering solid results? The answer seems to be yes. The drugmaker has already started preparing its post-Keytruda plans. It is currently waiting for approval for a therapy that looks destined to become a blockbuster: sotatercept, a potential treatment for pulmonary arterial hypertension (PAH).

Sotatercept has a mechanism of action which, unlike existing PAH therapies, allows it to target the underlying causes of the disease. While Merck got its hands on sotatercept through an acquisition, it is also relying on internally developed products, such as the highly promising MK-0616. This potential medicine is currently undergoing a phase 3 study in treating hypercholesterolemia (high cholesterol in the blood).

MK-0616 delivered excellent results in early-stage studies, and it could be the first oral medicine of its kind to get approved for hypercholesterolemia (others are typically administered via infusion, a less attractive option for patients). Some analysts see MK-0616 and sotatercept racking up combined peak annual sales of more than $10 billion.

That's not enough to replace Keytruda's more than $20 billion in annual sales, but it's a start. The company has a pipeline full of other promising candidates, including a subcutaneous version of Keytruda. In my view, even if Merck's sales drop somewhat following its crown jewel's patent cliff, the company should be able to recover and produce solid financial results and stock market performances through most of the next decade, thanks to a solid underlying business and rich pipeline.

Merck is also a solid dividend stock. The company has increased its payouts by 40% in the past five years and offers a 2.58% yield, higher than the S&P 500's average of 1.47%. Opting to reinvest the dividend with Merck is a great idea that should lead to superior returns in the next 10 years.

2. Fiverr

Fiverr runs a platform that helps connect freelancers and experts in various industries with individuals and businesses that want to hire them. The tech company has not performed well over the trailing-12-month period. That's partly because of the pandemic effect. Fiverr's business became much more popular in the early days of the outbreak, but that tailwind came to a brutal end.

In the third quarter of 2023, Fiverr's revenue of $92.5 million increased by 12.1% year over year. While that's better than the top-line growth rates it reported most of last year, it is still massively down from its early pandemic highs.

FVRR Revenue (Quarterly YoY Growth) Chart

FVRR Revenue (Quarterly YoY Growth) data by YCharts

However, the good news is that Fiverr is making headway on the bottom line. The company has been implementing cost-cutting measures that seem to be paying off. In the period, it reported net earnings per share of $0.07, compared to a net loss per share of $0.31 in the year-ago period. Fiverr becoming profitable should help boost its performance. In fact, the company's stock jumped in the past three months.

Whether it will keep this momentum throughout this year is anyone's guess, but the company's long-term prospects look attractive. The gig economy is on the rise. More people are choosing to freelance, be it part-time or full-time, partly because it provides substantial flexibility. Businesses also enjoy hiring freelancers since it is cheaper and faster than taking on full-scale employees.

Fiverr is a leader in what it does. The company's platform benefits from the network effect. As more freelancers join its website, it becomes increasingly attractive to businesses, and vice-versa. Fiverr sees an addressable market worth $247 billion. The company does not need to grab it all -- even 1% of this total would help catapult its sales much higher, along with its share price.

In my view, Fiverr is well-positioned to accomplish that in the next decade.