Theodore Roosevelt used to walk to church, gathering up whatever youngsters he came across on the way and depositing them in Sunday school. He was in his pew at Grace Reformed Church almost every Sunday, and when he couldn't make it he would send the pastor a note.

When Herbert Hoover was elected president, two branches of Quakers forgot their differences and built a new Meeting House where the nation's first Quaker president could worship. They even catered to his request for an archway of roses, which still blooms bright pink every summer at the Florida Avenue Friends Meeting House.

Because the White House falls within the parish of the Roman Catholic Church of St. Stephen, Martyr, John F. Kennedy transferred his membership there from Holy Trinity in Georgetown when he was elected president. But he went to mass at different churches to evade the tourists and preserve as much privacy as he could.

An individual's religion is traditionally a private matter -- unless he gets elected president, in which case it becomes a media event and the focus of some forms of celebrity-seeking.

Despite constitutional guarantees of the separation of church and state, Americans expect their presidents to be church-going men, whether or not they are particularly religious. The election of every new president sets off in Washington's religious community the quadrennial guessing game over where the new president will go to church.

The tradition of a First Church for the First Family began with George Washington. Even though he served his two terms as president in New York City, which was then the U.S. capital, well-polished brass plaques mark the Washington family pew in Christ Church (Episcopal) in Alexandria, where he was a vestryman.

Ever since, there has been a sort of on-again, off-again tradition that succeeding presidents visit the historic Christ Church some time during their incumbency, preferably on the Sunday nearest Washington's birthday.

While becoming the presidential church is a guarantee, particularly today, of instant fame, it does not always bring good fortune.

St. Thomas Episcopal Church, for instance, was so jammed with visitors when Franklin Delano Roosevelt attended there that "people would stand on pews to see him getting communion," said the Rev. Henry Breul, the present rector. But the regular parishioners were crowded out, became upset and left the parish for a quieter place of worship. About half the congregation melted away during those years.

Some of the regular members at National Presbyterian Church felt the same way last Sunday after fighting their way through the lines of demonstrators, security personnel and tourists who had come to glimpse Ronald Reagan and his entourage.

Moving into the media spotlight can be somewhat hazardous for presidential pastors, too. The first Sunday that Gerald R. Ford attended Immanuel-on-the-Hill (Episcopal) Church in Alexandria as President Ford (the Fords had been active in the church for most of his years in Congress), the Rev. William L. Dols Jr. came back from a New England vacation to replace the Rev. Patricia Park, who had been scheduled to preach that Sunday.

Senior pastors have been pulling rank on their juniors since time immemorial, but when they do it in front of the White House press corps, the result, a chastened Dols discovered, can be a lot of criticism.

Many members of First Baptist Church agree that the bitter dispute 18 months ago that resulted in the ouster of the Rev. Dr. Charles Trentham was heightened by the attention the church drew as President Carter's church. w

Then, too, there is the question of freedom of the pulpit. In times of great disagreement in the country, such as the Vietnam war era, it boils down to this: How does a pastor who preaches to the president walk the narrow line between irrelevance, on the one hand, and on the other, the temptation to use his position as a religious spokesman to assail presidential policies.

Harry Truman addressed this problem in a letter to his pastor, the Rev. Edward Hughes Pruden. "I don't want you ever to feel that you are in any way handicapped in your freedom of speech and expression just because I happen to be [in the congregation]," Truman wrote Pruden, who was pastor of First Baptist Church then. "I want to be treated like every other citizen and every other good Baptist." "

But in a more volatile era, Lyndon B. Johnson, who liked to visit different churches, once found himself being lectured from the pulpit of the historic Bruton Parish Church in Williamsburg. During a 1967 visit, Johnson was told by the Rev. Cotesworth Pinckney Lewis that "there is a rather general consensus that what we are doing in Vietnam is wrong" and that the American people demanded a "straightforward" explanation of the nation's continued involvement in Vietman. In the national controversy that erupted, Lewis was both praised and criticized, but most clergy, even those who were critical of the Vietnam involvement, felt Lewis had taken unfair advantage of a captive audience.

Throughout Washington, churches have their presidential lore.

Members of Metropolitan Methodist Church always knew there was something momentous going on in the country if President William McKinley failed to appear in his accustomed pew. The 25th president not only was a member of the church but he also served on its board of trustees. And Mrs. McKinley served on the committee to retire the church's debt.

Warren Harding went to Calvary Baptist Church fairly regularly, where, according to church lore, his paramour smiled down at him from the balcony. But he almost never took communion, because he felt himself "unworthy," he told the pastor.

Dwight D. Eisenhower had never belonged to a church, so it was considered quite a coup when the Rev. Dr. Edward L. R. Elson recruited him and baptized him in the National Presbyterian Church.

Just as they do today when a president is in sight, the celebrity-seekers crowded out church members to get a glimpse of William Howard Taft when he went to All Soul's Unitarian Church. After he became chief justice, the church chose him as layman of the year. Taft also served a term as president of the Unitarian General Conference.

During the years Richard Nixon was in Congress, he and his wife Pat sent his daughters to Sunday school variously at the Florida Avenue Friends Meeting, Westmoreland United Church of Christ and Metropolitan Memorial United Methodist Church, and attended the latter church occasionally. But when he became president, he rarely went to an established church. Instead he invited preachers to the White House for private services. His critics said he chose only religious leaders who would not fault his political policies.

There were private services in the White House during FDR's later years, too, as the president's health made it increasingly difficult for him to get out. Once a month, the choir and rector of St. Thomas arrived in the afternoon to conduct evensong for the first family. s

With so many pitfalls waiting for the church of the president, it may be that local pastors are breathing a sigh of relief at the word that President Ronald Reagan has no plans -- at the moment anyway -- to join a Washington church.