HOUSTON—Texas helped lead the U.S. out of recession, thanks in part to the shale drilling revolution. But after more than two years of slumping oil prices, the state is now a sore spot for the national economy.

Petroleum prosperity helped usher in an economic boom in Texas, which added one out of every seven new American jobs between 2010 and 2014. But since the end of 2014, the state has lost more than 91,000 jobs in oil-and-gas extraction and mining-support activities, nearly half of the total national job losses in those...