President Carter and Sen Edward M. Kennedy (D-Mass.) got together last night, finally clasping hands in the kind of victory salute that never came off at the Democratic National Convention in August.

The occasion was a fund-raising "uinty dinner" at the Sheraton Washington Hotel, where the two men, bitter rivals during the primaries, joined together to urge the defeat of Ronald Reagan and to raise money for each other.

About 500 Democrats paid $1,000 per person for the dinner and entertainment by composer Leonard Bernstein, actor Kirk Douglas and singers Carol Channing and Billy Eckstine.

The exact division of the money between the president's reelection committee and Kennedy will depend on provisions of the federal election law, but the bulk of the proceeds is expected to go to Kennedy to reduce his $1.6 million debt from the primaries.

Kennedy, picking up Carter's main campaign theme that Reagan's election would increase the risk of war, cited the Republican nominee's opposition to the pending strategic arms limitation treaty with the Soviet Union.

"We Democrats believe in reducing the risk of nuclear war," he said. "We dare not scrap that treaty. Because of where he stands on that issue, I take my stand with President Carter."

Kennedy pledged to campaign for the president "all the way to Election Day." And when he introduced Carter to the crowd, the two men clasped hands and raised them over their heads -- the kind of gesture of unity that did not occur on the last night of the Democratic convention.

Carter, who badly needs Kennedy's all-out support in the remaining two weeks of the campaign, was effusive in his praise of his primary rival.

In an unusual gesture, the president also gave Kennedy a watercolor portrait of his brother, the late president John F. Kennedy, that had originally been donated to Carter by the artist, Jamie Wyeth. Carter said he wanted the portrait to hang in the Kennedy presidential library in Boston.

Two similar fund-raising dinners to raise funds for both Kennedy and Carter are tentatively planned for December, according to Carter campaign officials.