Montgomery County Executive Charles W. Gilchrist said yesterday he had agreed to turn over the county's troubled cable television system to a company that promises to deliver cable service to nearly all county households by 1991 while cutting the number of channels and raising viewer fees.

Gilchrist, who has been angered and embarrassed for months by thousands of customer complaints about shoddy cable service, said transferring local cable programming from Tribune-United Cable Co. to Hauser Communications Inc. -- which has the Arlington County cable franchise -- is "a fine resolution" to one of the thorniest problems of his administration.

"This means completion of a top-quality cable service and protection of a large proportion of cable users," Gilchrist told reporters at an afternoon news conference.

The three-way agreement must be approved by the County Council and the 15 independent municipalities that joined Tribune-United's countywide cable network. There were preliminary signs yesterday that those approvals would be granted by Nov. 14, the deadline set by the three principal parties.

For 21,374 current cable subscribers and 220,000 families who await cable TV service, Montgomery's experience with Tribune-United has been a story of disillusionment, bitter lawsuits and angry rhetoric on both sides.

After promising county residents a full menu of programming services more than three years ago, Tribune-United was forced for a variety of reasons to cut back to subsistence levels, even suspending construction of its system nearly eight months ago.

The central feature of Gilchrist's agreement with Hauser and Tribune-United is to brush aside those longstanding differences in exchange for $7 million in cash from Tribune-United and a series of payments from Hauser to the county that could add up to $62 million over the 12-year life of the franchise.

In return, the county agreed to allow Hauser to cut the 120 cable channels once promised by Tribune-United to 61, and Hauser could raise monthly service fees after January, according to company officials, who appeared with Gilchrist yesterday.

Hauser and county officials declined to release figures on possible rate increases or construction timetables. Much of that information, they said, will be released at the first public hearing on the agreement. The hearing has been tentatively scheduled for Aug. 14.

In Arlington, customers pay a basic service rate of $14.20 per month, and the typical subscriber spends an additional $14.30 per month for special programs, according to Hauser President John Evans.

Tribune-United customers in Montgomery pay a basic rate of $1.50 per month, although typical subscribers add $20 to $30 per month to obtain a variety of "premium" shows.

Evans said his firm is contemplating increasing basic rates in Montgomery to a level that is "comparable" to those in Arlington.

"The county has negotiated the best deal it can," said Don Vandrey, a spokesman for the city government of Rockville, one of the jurisdictions that must approve the agreement. One-third of Rockville households have cable service.

David L. Scull, chairman of the County Council committee that has overseen Tribune-United's activities since it won the franchise in 1983, said, "I'm glad to hear of any progress."

He said the council would study the agreement to be certain that "the bargain is a fair one for the public and financial security is provided" to protect the county from possible losses.

Hauser Chairman Gustave M. Hauser sought yesterday to draw a sharp distinction between the performance of his company, which serves 125,000 subscribers in Arlington and the Minneapolis-St. Paul area combined, and Tribune-United's uneven record.

"Cable has been battered around" in Montgomery, Hauser said. "Whether it was deserved or not, it's history. We're going to move forward . . . . We will have service second to none in this country."

In Arlington, county Cable Administrator Gary Smyth gave Hauser Communications generally high marks for its recent performance. There have been six consumer complaints against the firm this year, he said, compared with at least 40 in 1985.

Hauser, which obtained the Arlington franchise in a 1983 transfer, provides cable service to about 35,000 households there. "Hauser is cooperative. We've never had a problem in reaching them," Smyth said.

"Arlington is a model for the industry," Hauser's Evans said. "Let there be no mistake . . . . Customer service will be exceptionally important to us in Montgomery County."