After months of speculation, Buckingham Palace made it official yesterday that Britain's Prince Charles and Princess Diana will visit Washington Nov. 8-12. At the same time, the White House announced that President and Mrs. Reagan will give a private dinner in the royal couple's honor on Nov. 9.

"It is a major visit for the royal couple," a British Embassy spokesman said.

Timed to coincide with the National Gallery of Art's most ambitious exhibition to date, "The Treasure Houses of Britain: Five Hundred Years of Private Patronage and Art Collecting," the couple's Washington stop will come en route home from a two-week tour of Australia. Prince William, 2 1/2, and Prince Harry, 7 months, will not accompany their parents, the embassy spokesman said.

Unlike her husband, who has paid at least seven visits to the United States, the 23-year-old princess will be making her first. She and Charles, 36, changed planes in Los Angeles in April 1983 when they were returning from a tour of Australia but did not make any public appearances. They went on to spend a few days in the Bahamas.

National Gallery Director J. Carter Brown said Charles and Diana, the exhibition's official patrons, will tour the show on Nov. 10, a week after its opening, which many of Britain's titled lenders will attend. Brown said the royal pair also has accepted an invitation to a dinner the gallery will give on Nov. 11.

"We're absolutely delighted," Brown said. "When Paul Mellon originally wrote the prince of Wales inviting him to be a patron, we understood that he couldn't make a promise to come."

Featuring 700 works collected from more than 200 houses in England, Scotland and Wales, the furniture, sculptures, paintings, porcelaines, tapestries and other 15th- to 20th-century pieces will be installed in nearly 35,000 square feet of space in the East Gallery.

Among the paintings will be a shooting scene by 18th-century English painter John Wootton that comes from Charles and Diana's own collection in their country home, Highgrove.

The British Council, which is the cultural arm of the British government, first suggested a major exhibition devoted to British art in 1979. Brown's response was that the show should focus on the British country house as "a vessel of civilization," selecting artworks illustrating 500 years of collecting and patronage.

In 1981, during a visit Prince Charles made to Washington before his marriage to Lady Diana that summer, he asked Brown at a British Embassy dinner party what effect the show might have on the British economy, specifically tourism. Many of the houses are popular stops for both British and foreign tourists.

Later, compiling the exhibition's Committee of Honor, Brown said he and other gallery officials thought it "only logical that a member of the royal family be the show patron." Paul Mellon, the National Gallery's president emeritus, subsequently issued that invitation in a letter to Charles.

The show, sponsored by the Ford Motor Co., runs Nov. 3 through March 16, 1986. It will not travel out of Washington because many of the loans must be returned and in place for the start of the 1986 tourist season.

An aide to the Reagans said no details were available on the dinner they will give. Similarly, the embassy spokesman said no details were available of Charles and Diana's other activities in Washington.

In another royal visit, unconfirmed by Buckingham Palace, Queen Elizabeth reportedly will make a stop on the Caribbean island of Grenada in October, officially signaling a return to normality two years after the U.S. invasion. Quoting "sources," Reuters said the queen will go to Grenada following a summit meeting of Commonwealth leaders in the Bahamas.