About 3,000 people, including members of Congress, the Cabinet, the Supreme Court, some state governors and many from the diplomatic corps, joined President Reagan yesterday morning at the annual presidential prayer breakfast to pray, sing hymns and offer the chief executive arousing chorus of "Happy Birthday."

The president, who is celebrating his 70th birthday today, concluded the prayer session with a testimony of his own need for divine guidance. But first he thanked the gathering for the good wishes on the occasion of "the 31st anniversary of my 39th birthday."

Reagan said the occasion reminded him of gubernatorial prayer breakfasts he presided in California. He said he was convinced God would sustain and help him over difficulties he will face as president. "If I did not believe that I could not face the days ahead," he said.

Evangelist Billy Graham spoke briefly to give the history of the prayer breakfast movement. The tradition, he said, dates to President Eisenhower. He recalled how Eisenhower, shortly after his election, "told a young preacher who came to call on him that he felt he was elected to help lead the nation in a spiritual renewal." The "young preacher" was Graham.

"Every president since 1954 has continued the tradition" of the massive annual prayer breakfast, Graham continued, and added that many state governors and some mayors have taken up the idea. "I believe the prayer breakfast movement has played a significant role in the revival of religious interest in America," Graham said.

The logistics of the presidential prayer breakfast are coordinated by a local, low-profile, evangelical Christian organization known as Fellowship House. One of the prime movers in that group is former U.S. senator Harold Hughes of Iowa. Prayer groups that meet weekly or monthly in both the House of Representatives and the Senate help to host the event. The breakfast is by invitation only.

Mayor Edward I. Koch of New York City worked in a quick commercial about his home town before he read the Eighth Psalm. New York, he said, is "a city of cultural and religious diversity . . . where mass is said each morning in 23 languages."

Vice President Bush read the familiar passage from the New Testament book of First Corinthians extolling a loving spirit, which begins: "If I speak with the tongue of men and of angels and have not love . . ."

In a brief message, Gov. Albert H. Quie of Minnesota gently deplored the national tendency to neglect the spiritual side of life. "We don't speak easily of spiritual matters," he said.