On his 64th birthday yesterday, World Bank President Robert S. McNamara called a meeting of his executive board and, to its surprise, announced he would resign a year from now on his 65th birthday.

For the past 20 years, the former Ford Motor Co. "whiz kid" has been a dominant and controversial figure in Washington, first as secretary of defense during the bitter period of the Vietnam war, and since 1968 as head of what has come to be known as "mcNamara's Bank."

In 1981, McNamara will have completed three years of a third five-year term. Traditionally, the president of the World Bank has been an American, while the head of its sister organization, the International Monetary Fund, has been a European.

In a brief statement yesterday, McNamara said that the time is approaching when it would be "appropriate" for a change in bank leadership. An aide volunteered "there is nothing political" in McNamara's decision to quit. There was no indication yesterday who a successor might be.

However, in the event that Ronald Reagan is elected president, the name of William E. Simon, former secretary of the treasury, may come up, Republican Simon -- who bitterly opposed McNamara's expansionist lending policies in President Ford's final year -- is known to have expressed an interest in the World Bank job.

McNamara was president of the Ford Motor Co. in the 1950s, and had never met president-elect John F. Kennedy until after the 1960 election. But they struck up an immediate warm and tight relationship, and McNamara gave up 13 million in Ford stock and options to take the then $25,000-a-year defense job.

He became an immediate power in the Kennedy Cabinet, his smooth performance winning the wistful approval of Vice President Lyndon B. Johnson, who confessed to a friend: "I like that fella with the Sta-Comb in his hair."

McNamara brought an industry approach to management into the Pentagon and proceeded to impose it on the vast, bureaucratic military establishment. They didn't like it, but he asserted civilian control over everything.

His critics complained that he tried to treat the Vietnam war as a management problem, too, complete with body counts to judge the progress. But the war didn't compute, and McNamara's "whiz kid" reputation became one of its casualties.

When he and President Johnson split over the continued bombing of Vietnam, McNamara left the Pentagon on Feb. 29, 1968, and one month later succeeded George D. Woods as head of the World Bank, technically known as the International Bank for Reconstruction and Development.

In the past 12 years, McNamara has become a passionate advocate of the poor and needy nations, and in the process has shaken up the private banking world, which thought he was going too far and too fast. The less-developed nations, on the other hand, views McNamara as their most influential champion in the richer world.

He made good on his promise to double, then triple, world bank lending. Today, the World Bank is the main source of development funds for the poor nations of the world.

In the year prior to McNamara's takeover at the bank, it had 767 employes and made 60 loans totaling $954 million. In the fiscal year about to end this month, the bank staff of 2,400 will have made about 250 loans, totaling $11.7 billion.

Allowing for inflation, World Bank officials yesterday said that this is the equivalent of a threefold increase.

There has been a shift in emphasis, as well, from the huge electric power and transportation projects that used to dominate World Bank lending to more money for agriculture, water projects, education and a variety of other programs. Some money is going into petroleum development, and a little may go this year into financing balance of payments deficits -- a break with tradition.

In a sense, McNamara has become the conscience of the rich nations, articulating the case for an ever-increasing volume of aid. In 1969, in a landmark speech at Notre Dame University, he laid out a compelling case that the problems of the poor could not be tackled without dealing with birth control.

He was one of the leaders in the movement -- still resisted by the United States -- for a large common fund to help the developing countries stabilize their exports earnings.

In his featured and emotional annual addresses to the joint annual meetings of the bank and the International Monetary Fund, McNamara regularly touched off new initiatives, among them the need of the ruling elites in poor countries to do something more than talk about the problems of their own poorest population.

McNamara's insistence on redistribution of wealth, with greater attention to the overwhelming problems of poverty and disease, has been criticized as overambititious. The former defense secretary, it has been noted, now wants to spend more for butter, less for guns.

This ardor on behalf of the poor, with a missionary zeal, must be -- some say -- an over-compensation for everything that is suggested by the label "McNamara's war."

But he doesn't seem to care. Once, at a World Bank reception, he expressed his deep-seated belief this way: "Man cannot live by GNP alone. That's what we've got to get them to understand."