Graphics-chip maker Nvidia Corp. benefited from continued hot demand for devices from computer videogamers and cryptocurrency miners, pushing its sales and profit to records in its most recent quarter.

Nvidia has been one of the tech companies that profited most handsomely from the pandemic-era economy, when millions of people turned to videogames, online services and other home-based activities during lockdowns.

Sales rose by 68% to $6.51 billion in the period ended in July, the company said. Net profit nearly quadrupled, reaching $2.37 billion.

The company’s latest generation of graphics cards are popular with computer gamers for whom high-quality images and fast frame-rates are prized. Its high-end cards have sold out fast, and resellers have responded to demand by buying available stocks and marking them up well above their list price.

The cards are also well-suited to the computing-power demands of cryptocurrency mining. To avoid that demand crimping the supply of components for gamers, Nvidia sells products specifically for the digital-currency creation market. It also has put in place software designed to limit the usefulness of its gaming cards for crypto-mining. Chief Financial Officer Colette Kress said more than 80% of the company’s latest graphics cards had those limiters on them, adding that crypto-specific chips would be a minimal contributor to future revenue.

Nvidia has managed to continue growing its sales in recent quarters despite a world-wide shortage of chips that has forced some auto makers to pause production and is spreading to a wider set of industries.

Demand continues to outpace supply, Ms. Kress said on an earnings call.

While gaming and data-center chips are core to Nvidia’s business, inroads have been made into other areas, including autonomous driving and emerging forms of digital collaboration and entertainment. Chief Executive Jensen Huang said Nvidia also aims to play a key role in enabling the emerging field of metaverses, the extensive online world transcending individual tech platforms, where people exist in immersive, shared virtual spaces. Some tech heavyweights believe these will be at the heart of the next phase of the internet. Over 500 companies and more than 50,000 individual creators have shown interest in the company’s metaverse tool, called Omniverse, Ms. Kress said.

The company’s shares have shot up since the onset of the Covid-19 pandemic, giving it the momentum to help finance a $40 billion bid last year for Arm Holdings, which designs microprocessors that power most of the world’s smartphones.

The transaction would be the biggest-ever deal in the chip industry and would help catapult Nvidia into areas, such as phone chips and CPUs, where it previously only dabbled. But the deal faces significant challenges, including opposition from competitors of Nvidia who license Arm’s chip designs and scrutiny in the U.K., where the deal is undergoing a national-security review.

Ms. Kress said the company’s efforts to buy Arm are slowly working their way through regulatory approvals.

“Although some Arm licensees have expressed concerns or objected to the transaction, and discussions with regulators are taking longer than initially thought, we are confident in the deal and that regulators should recognize the benefits of the acquisition to Arm, its licensees, and the industry,” she said.

Nvidia’s gaming revenue was $3.06 billion in the second quarter, a record and a 85% increase from the same period a year ago.

The company also said its revenue from data-center sales, where its chips are widely used in artificial-intelligence calculations, reached $2.37 billion, up 35% from the year-ago period.

Nvidia’s sales and profit were both higher than analysts surveyed by FactSet on average expected.

The company suggested Wednesday that the wave it is riding has yet to crest. Revenue for the current quarter should be around $6.8 billion, Nvidia said, higher than Wall Street forecasts.

Chip-supply shortages affecting the company’s gaming business are expected to persist throughout the current quarter, Ms. Kress said.

Nvidia’s shares rose by about 1.6% in after-hours trading.

Write to Asa Fitch at asa.fitch@wsj.com