Intel Corp. Chief Executive Pat Gelsinger sees the global semiconductor shortage potentially stretching into 2023, adding a leading industry voice to the growing view that the chip-supply disruptions hitting companies and consumers won’t wane soon.

The world-wide shortage has fueled rising prices for some consumer gadgets. Meanwhile, the auto industry has been particularly hard-hit as the lack of a key component causes production delays. German car maker Volkswagen AG this month warned the global shortage could worsen over the next six months. Others have said they were bracing for problems through next year.

It could take one or two years to get back to a reasonable supply-and-demand balance in the semiconductor industry, Mr. Gelsinger said in an interview after the company posted second-quarter earnings on Thursday. “We have a long way to go yet,” he said. “It just takes a long time to build [manufacturing] capacity.”

Supply shortages should start showing signs of easing later this year, Mr. Gelsinger said, echoing comments from Taiwan Semiconductor Manufacturing Co., the world’s largest contract chip maker. TSMC last week said the chip shortage that has hampered car makers could start to ease in the next few months after it ramped up its production of auto chips.

TSMC and Intel are adding new chip-production plants, though some of that capacity won’t be ready for about two more years.

Since rejoining Intel in February, Mr. Gelsinger has moved aggressively to revive the chip giant after it made a series of missteps. He has committed to establishing a contract chip-making operation, announced major factory expansions and lured back talent to restore the Silicon Valley icon’s technology prowess. The company also is in talks to potentially buy GlobalFoundries for around $30 billion, The Wall Street Journal has reported, in what would be its biggest-ever acquisition and a signal of how serious Mr. Gelsinger is in making Intel a merchant chip producer.

Mr. Gelsinger declined to address the takeover talks, but said “this will be a consolidating industry for the long term, and we’re one of the companies that can be a consolidator.”

Intel said second-quarter sales and profit were broadly flat from a year earlier at $19.6 billion and $5.1 billion, respectively. Wall Street on average expected sales of $17.8 billion and a $4.2 billion profit, according to analysts surveyed by FactSet.

“The digitization of everything continues to accelerate, creating a vast growth opportunity for us and our customers across core and emerging business areas,” Mr. Gelsinger said in a statement Thursday.

Although Intel’s results and guidance came in ahead of Wall Street’s expectations, the figures suggested that the company’s profit margins could slip toward the end of the year, according to Bernstein Research analyst Stacy Rasgon. Intel shares fell 2% in after-hours trading.

The PC market has been booming and is poised to continue to do well, Mr. Gelsinger told the Journal, as people and companies replace old hardware amid the post-pandemic return to work and the release of Microsoft Corp.’s Windows 11 later this year.

“Even as people go back to work, they’re largely going back to hybrid work,” he said. “We see that continuing, this need for PC density, for [more] PCs per household.”

A recent slowdown in hardware orders from big operators of data centers following a surge last year was largely over, he added.

The company also lifted its full-year outlook, projecting $77.6 billion in revenue, or $600 million above the earlier figure. Analysts had been expecting $72.7 billion in sales this year. The outlook for the current quarter also came in ahead of expectations.

Sales of Intel’s data-center chips in the second quarter fell to $6.5 billion, short of the lofty heights of a year ago, when the pandemic drove rapid uptake in the cloud-computing services that rely on such facilities. Intel also faces stiffer competition from Advanced Micro Devices Inc., which has eaten into its dominant share in data-center chips. Sales for the PC-centered business rose 6% to $10.1 billion from the year-ago period.

Mr. Gelsinger in March first unveiled his turnaround plan, along with more than $20 billion investments in two plants in Arizona. He followed, in May, with a $3.5 billion expansion effort in New Mexico. Additional capacity growth, in the U.S. and abroad, is in the planning stages.

Intel may get help from new government incentives to erect those facilities. A bill earmarking $39 billion for domestic chip manufacturing and billions of dollars more for research and development was approved in the U.S. Senate in June. The House still has to pass its spending measure before it goes to the White House for President Biden’s signature.

Europe and Asian countries are luring chip makers with incentives to land more capacity and ensure access to a technology increasingly viewed as crucial for national security.

Intel faces stiff competition in the chip-building market. TSMC and No. 2 Samsung Electronics Co. are spending big to stay ahead. In April, TSMC said it would spend $100 billion over three years to expand its capacity, while Samsung plans to invest $116 billion by 2030 to move beyond making computer memory chips.

Rival chip designers that largely rely on TSMC and Samsung to make their processors also are pressuring Intel. AMD, long a distant second to Intel in the market for central processing units, had nearly a 20% share in personal computer CPUs in the first quarter, according to Mercury Research. That compares with just 8.5% in 2017.

AMD’s sales have jumped despite facing some of the same challenges as Intel in the shift toward cheaper notebooks and an easing of datacenter buying. In the first quarter, AMD revenue nearly doubled compared to the year prior, and analysts broadly expect a similar performance when it reports quarterly results next week.

Other chip-makers have also reported strong sales during the pandemic’s height and into this year. Texas Instruments Inc. reported a surge in revenue and profit on Wednesday.

Nvidia Corp. , which specializes in graphics processing chips, is working on a CPU for data centers that will compete with Intel’s. Nvidia surpassed Intel last year to become the most valuable U.S. chip maker; it reported record revenue in its latest quarterly results in May.

Intel said sales in the current quarter should reach around $19.1 billion.

Mr. Gelsinger is expected to present more details about the company’s technology plan later this month.

A global chip shortage is affecting how quickly we can drive a car off the lot or buy a new laptop. WSJ visits a fabrication plant in Singapore to see the complex process of chip making and how one manufacturer is trying to overcome the shortage. Photo: Edwin Cheng for The Wall Street Journal The Wall Street Journal Interactive Edition

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