Mayor de Blasio has played Santa Claus all year with New Yorkers’ money — but the Grinch may be coming.

Thanks to the mayor’s bad budgeting, when recession hits (and one always does, sooner or later), cuts to programs that make life better for the poor — like after-school programs and free summer swimming — are certain.

State-backed firms in these countries have borrowed tens of billions in American dollars to invest in oilfields that no longer make financial sense.

Why should New York care about corrupt Third World companies’ financial practices?

Because these firms borrowed all that money from global banks and investment funds, largely based in New York. Bond prices have plummeted as investors fear that they won’t be repaid — meaning that Wall Street could be starting the New Year with some losses.

That means less tax money from stock and bond sales, bonuses and bank profits.

Plus, a big reason for oil’s drop is that the Chinese economy is slowing. With China needing less oil, steel and copper, countries that sell that stuff — Brazil and other big resource-exporters — are suffering their own slowdowns.

That means less economic growth in the parts of the world that weathered the 2008 financial crisis better than we did. For New York, it could mean fewer tourists from these places — and fewer sales-tax and hotel-tax dollars.

Well,recessions do happen. “The possibility of an economic setback increases with each year,” state Comptroller Tom DiNapoli warned last week. “Changes in the business cycle are inevitable.”

Indeed, if you’re mayor of New York, the one thing you can count on is a recession.

John Lindsay, who took office in 1966, had two. Abe Beame, a one-term mayor, took over in 1974 during economic turmoil. Ed Koch had two recessions in three terms. David Dinkins had one during his single term. Rudy Giuliani and Mike Bloomberg had one recession each.

There are signs, too, that we should be on the alert. Real-estate-transaction taxes — a bellwether of the property market — are starting to reach levels we haven’t seen since 2006, when the last boom began to falter.

Income taxes and business taxes are reaching their bubble-era peaks, too.

So is de Blasio, who is supposed to be so forward-looking, budgeting for the inevitable? Laying plans so that, when the downturn comes, he doesn’t have to cut back anti-poverty programs?

Nope. The new mayor has increased the risk that the city’s vulnerable will suffer more than necessary.

De Blasio has been busy giving out raises that the city can’t afford.

Spending next year will be more than $1 billion more than it was supposed to be, the comptroller notes. We’ll spend another $1 billion extra the year after that.

We have no room for error. The city faces $5 billion in deficits in the next three years, even if everything keeps going gangbusters.

And what if we have a long downturn — or a slow recovery?

The mayor’s attitude toward paying for teachers’ retroactive pay — dating back to 2009 — wasn’t, “Wait ’til next year.” It was: Wait ’til 2018 through 2021. “The cost of [the] new labor agreements will be greatest in those years,” DiNapoli notes.

So come 2018, we’ll be spending more than $3 billion a year in extra costs, much of it for work done by teachers the previous decade.

The mayor, then, is expecting that good economic times will last well more than a decade — something that hasn’t happened in modern history.

And these costs never really go away. Thanks to higher pay, the city’s pension payments for city workers, too, will cost $500 million more a year . . . forever.

If the mayor is wrong, city workers and retirees won’t suffer. They’ve got theirs locked in, no matter what happens.

It’s the people who depend on city services who’ll feel the pain — schoolchildren, public-hospital patients and other poor New Yorkers who can’t buy private services when public ones are cut.

De Blasio, in short, is actually balancing his budgets on the backs of the poor. The global economy will decide when to present them with the bill.

Nicole Gelinas is a contributing editor to the Manhattan Institute’s City Journal.