James Callaghan had to wait until he was 64 to become prime minister, a job he relishes enormously. Thursday night, he won a vote of confidence that virtually ensures that he can stay at 10 Downing Street until he is ready for an election.

The vote amounted to a last-gasp effort by the Conservative Party opposition to force out Callaghan before he is legally compelled to face the voters in October of 1979. Callaghan's minority Labor Party government won by 312 to 300.

The margin masked Callaghan's real strength. His Labor Party fills only 308 of the 635 seats in the House of Commons. He can however, call on 41 other votes from minor parties whenever he needs them to survive.

Thursday night, it was the three Welsh Nationalists and eight Ulster Protestants who gave him the margin he sought. In a pinch, to avoid a quick election, he would also be backed by the 13 Liberals, 11 Scottish Nationlists and the remaining Ulster and Scottish members.

Some commentators here warned in advance that the confidence vote would be a "cliff hanger," that the outcome was much in doubt. But they were wrong. For different reasons, the minor parties are no more eager to get rid of Callaghan than Callaghan himself.

The vote came on a Conservative motion decrying the government's economic policies. There was no reason in logic, let alone politics, for the 280 Conservatives to pick up the support they needed. The economic policies of the two major parties are virtually indistinguishable.

Indeed, Margaret Thatcher, the Conservative leader, is rushing toward the center position so firmly straddled by Callaghan. She has all but embraced his anti-inflation guidelines to curb pay increases. She complains of his "rigidity," saying she prefers an "average" to a "norm," but these are distinctions, not differences over how to limit pay.

Similarly, Callaghan - who is about as socialist as David Rockefeller-has embraced what is supposed to be Thatcher's monetarism with both arms. Thursday, the Bank of England, Britain's Federal Reserve, raised its minimum lending rate or discount rate by a record 2.5 percentage points to 12.5 percent. Yesterday, this pushed up monthly payments for a Briton obtaining a 25-year, $30,000 mortgage from $270 to $314.

There is no discernible economic reason for this tightening of the monetary screw. Britain's inflation is now less than that of the United States.

What Callaghan was doing was backing up his payguideline with a monetary vengeance. About 57,000 Ford workers have been striking for seven weeks, refusing a pay increase three times the 5 percent limit the government has established.

Callaghan ordered the Bank of England to squeeze the money supply as a warning to every other union. If they do not observe his guideline, he is saying, he will be compelled to force the country into a recession. The conservative Callaghan has decided that holding down prices is good politics, even if it means higher unemployment.

Callaghan's political skill has also paid off in Parliament. He is sure that the minor parties will give him any confidence votes he needs because he has catered to all those that matter.

The Scottish and Welsh Nationalists want him in office at least until March 1. Then the ancient kingdoms are due to vote on a Callaghan measure to give them a limited degree of home rule.

The Ulster Protestants have been softened up by Callaghan's enforcement of the status quo in that province. The status quo preserves the best industrial jobs for Protestants and confines Catholics to the welfare lines or lesser paid work.

In addition, Callaghan has introduced a bill to increase Ulster's representation in Parliament from 12 to 18. That would probably increase the Protestant strength from 10 to 14 or 15. Catholics, who now hold two seats, would likely gain only one or two from the measure.

The devastated Liberals face virtual extinction in any election. They voted against the government Thursday night only because they were confident others would keep Labor in power.

To complete Callaghan's satisfaction, Thatcher's party has just endured a bitter division. To her dismay, 114 Conservatives voted the other day against continuing the ban on trade with Prime Minister Ian Smith's white-dominated government in Rhodesia.

Thatcher had to fire Winston Churchill, the wartime premier's grandson and Conservative deputy spokesman on defense, from her front bench. John Biggs-Davidson, her Ulster spokesman, resigned. Both voted against her party line to continue sanctions.

In fact, it is a phantom issue. Both Labor and Conservative governments have looked the other way for years while British oil and other companies have breached the ban. But that was no comfort to Thatcher.

A poll out yesterday shows that the Conservatives in a general election, would still beat Labor, 48 percent to 45. Embarassingly enough, this margin would widen to 54 percent to 40 percent if former premier Edward Heath was still the leader.

Callaghan - now a cheerful 66 - is confident he can pick up another five percentage points or so in a tough personal campaign against Thatcher. Whether or not this is so, he can - barring the unexpected - look forward to an untroubled political future until he decides to call an election.