Wary of dipping into its $1.3 billion endowment during perilous economic times, Harvard University is planning the largest fund-raising campaign in its history to pay for student aid programs and faculty salaries.

"We would never take from the endowment because it would be stealing from tomorrow to pay for today," a university spokesman said. "The endowment is there to yield a return. Right now we're just trying to fight inflation."

"I hate to be a prophet of doom and gloom," said Harvard's financial vice president, Thomas O'Brien. "Higher education will survive; Harvard is strong and we just want to keep it strong."

The nation's wealthiest university plans to raise $250 million, 90 percent of which will benefit the endowment, partially as a hedge against the risk of "major changes in the composition of the student body."

The warning, from a Harvard financial report for 1977-1978 released earlier this week, reflects projections that a cutback on grant money and escalating tuition costs will prevent middle-income students from attending costly private universities.

"It will crunch out the kids in the middle income and you'd be left with the rich, the poor who are getting a free ride on private and government scholarships and people who have to get so far into debt to attent that they'd rather go to a state school," said a source i Harvard's development office.

"The university has raised tuition and other student fees at rates that would be difficult to sustain without risking major changes in the composition of the student body," O'Brien wrote in the financila report on the fiscal yrar ended June 30.

"We want to maintain the diversity of our student body," he said. "The middle-income kids are some of our most capable students but they are having the most difficulty coming up with the expected parental contributions. It's a question of affordability."

Students from families in the $25,000 to $50,000 income bracket, he said, are usually ineligible for major sources of financial aid to pay the $7,500 annual bill for tuition, room and board.

The funds raised in the prposed campaign would allow the university to increase the $25,000 scholarship ceiling so that more students could receive financial assistance.

The fund-raising drive was prompted by a demand to bring professors' salaries in line with other leading univeristioes and to increase the pot grant money, O'Brien said.

Inflation and the declining stock market, he complained, have eaten away at the university's endowment, forcing an injection of new funds.

The endowment dropped by $63.3 million to $1.39 billion in the post fiscal year and the amounts of money given for scholarships dropped to$25.2 million, down $400,000 from last year, O'Brien said.

In 1968 the market value of the university's endowment was $1.13 billion, he said. In the past decade it has risen to only $1.39 billion "and the consumer price index has doubled in that time so you can see that the combination of high inflation and low capital market performance has been devastating."

Hardvard provided $39.7 million in scholarships and student loans in the past fiscal year, up from $37.1 million the previous year, "reflecting the increased use of loans to support a major share of student aid," according to Hardvard's financial report.

The fund-raising campaign will be headed by Albert H. Gordon, chairman of the board at Didder Peabody Inc., an investment banking firm based in New York; Robert G. Stone, chairman of the board of West India Shipping Co., based in New York, and Walter N. Rothschild Jr., a New York philanthropist and former chairman of the National Urban Coalition.

University officials said they planned to solicit funds from alumni, foundations and corporations. "Since our case is solid and our need for money apparent, our alumni will respond," O'Brien said. CAPTION: Picture, WALTER ROTHSCHILD JR. . . . aiding in fund-raising effort