Juanita M. Kreps resigned yesterday as secretary of commerce, citing "personal reasons" in a letter to President Carter. Kreps, the first woman to head the giant department, will depart at the end of this month.

Although her letter to Carter did not spell out what led to yesterday's decision, sources close to Kreps said it was because of a desire to be with her husband, who was recently released from a hospital in North Carolina following an attempted suicide in late June.

Clifton H. Kreps Jr., 59, a business professor at the University of North Carolina, was released from hospital care about two weeks ago, and his wife told several top Commerce Department officials at separate meetings late yesterday that she had decided to join him at their home in Durham.

Kreps met with Carter at the White House and he accepted the resignation, a spokesman for the Cabinet secretary said.

Carter told Kreps he wished she would remain in the Cabinet but that he would accept her decision to leave, United Press International reported.

["She's one of my favorite people and one of my favorite Cabinet officers," Carter told ABC News outside a restaurant last night. "If she leaves it would be a disappointment to me. I've asked her to stay on, but she has personal considerations. Whatever she does, I would agree with. I'll leave it up to her," Carter said.]

In Durham, N.C., Duke University Chancellor A. Kenneth Pye said Kreps, who is 58, would return to the university Nov. 1. Kreps was a vice president and professor of economics at Duke before joining the administration.

Financial pressures caused by medical expenses in connection with her husband's recent hospitalization, as well as his previous treatment in a psychiatric unit of North Carolina Memorial Hospital in Chapel Hill, also were cited by sources as one factor in yesterday's decision.

As secretary of commerce, overseeing a department with more than 40,000 employes and a $3 billion annual budgets, Kreps was paid $66,000 a year.

Before joining the administration in 1977, Kreps got $30,106 a year at Duke and an additional $61,150 as director of seven major corporations and the New York Stock Exchange.

The departure of Kreps provides Carter with the opportunity to make his seventh Cabinet-level appointment in recent weeks, following firings and resignations that have brought new leadership to the departments of Justice, Transportation, Treasury, Housing and Urban Development, Health, Education and Welfare, and the office of ambassador to the United Nations.

Administration sources said the president is likely to seek a "totally new face" for the Commerce job, "a big name in the business world."

One candidate mentioned last night was Export-Import Bank President John L. Moore Jr.

The mood of top Commerce Department officials was said to be "one of sadness, but resignation . . . that it finally had to happen."

There had been speculation ever since the incident involving her husband that Kreps would return to North Carolina.

Kreps was reported to be at her apartment in Arlington last night but could not be reached for comment.

Kreps gained initial attention as Carter's "no" woman at Commerce after she reminded him on national television -- on the eve of her appointment -- that "it would be hard to defend the proposition that there are not a great many qualified women" for Cabinet posts and that "we have to do a better job of looking." To which Carter responded: "I think she disagrees with me."

With recognition behind her from the worlds of economics, business and academia, Kreps launched a major reorganization of the Commerce Department. Progress has been slow, but Congress soon is expected to approve a major increase in economic development funding under a Commerce Administration. Kreps also was in the forefront of opening up U.S. trade agency, the Economic Development with China.

Kreps has sought to channel department employes into developing national economic policy but she has been thwarted, somewhat, by administration budget policymakers.