The pressures that had been building inside George W. Grayson came to a head early Tuesday as he tossed and turned in bed while television movies droned on into the night. For the past six weeks, his life had dissolved into nerve-wracking days and sleepless nights as he fretted endlessly over his campaign for Congress.

Recently, Grayson had turned to drugs--first sleeping pills, then a tranquilizer called Desarol prescribed by his doctor. But the strains of running for office proved too much and his insomnia was growing worse. By 3 a.m., his wife, Carmen, could stand it no longer.

"Does this make any sense?" she asked. "Is anything worth this much?"

The answer came the next morning. Grayson drove to his campaign office, gathered his staff and read a hastily drafted statement that left them in a state of numb disbelief. Grayson's voice wavered as he announced he was withdrawing as the Democratic candidate in Virginia's 1st Congressional District.

"I wanted to be able to sleep without putting a chemical in my body," he said.

The announcement this week stunned Virginia Democrats who had viewed Grayson as one of the party's brightest hopes for picking up a Republican seat in this fall's congressional elections. He was, on paper, the ideal candidate. An articulate 43-year-old state legislator and professor of government at The College of William and Mary, Grayson had rolled up hefty 60 percent electoral majorities in his recent campaigns for the House of Delegates.

Moreover, the political dynamics of the 1st District were entirely in the party's favor. Running from the Hampton Roads area to the Eastern Shore, the normally Democratic district had fallen to tireless Republican Rep. Paul S. Trible Jr. of Newport News six years ago.

But Trible left his seat to run for the U.S. Senate this year, and Grayson, capitalizing on disenchantment with Reagan economic policies, had forged a coalition that seemed headed for triumph. A private poll last month showed Grayson leading the Republican candidate, state Sen. Herbert H. Bateman of Newport News, by a 37-to-29 percent margin.

"The willingness of every spectrum in the party to support George was incredible," said John McGlennon, 1st District Democratic chairman and a colleague of Grayson's at William and Mary. "When we had our district convention, it was like a love feast.

"If George would have stayed in the race, he would have won," he said. "This hurts very much--to have invested a lot of time and effort into a campaign and then discover that you have to start all over again."

What drove Grayson to give up the prospect of a career in Congress is still being debated here among party leaders and campaign workers. Friends like McClendon described him as a driven man, an intense perfectionist who fussed over every detail of the campaign, down to how many telephone lines to install in the office.

"He wanted to know how every single facet of the campaign was going," said Jonathan Short, a campaign volunteer. "He would edit every campaign letter. He wanted to okay everything that went out." Grayson acknowledged there is truth in this. "I do worry a lot," he said. "I have since childhood."

But as he sat with his wife in the book-lined living room of his Williamsburg home recently, Grayson portrayed his aborted campaign in a different light. It was, he suggested, a casualty of an electoral system run amok. The demands of running for office--with its all-important premium on raising money--were staggering, he said. And the toll on family life and human values were more than he could take.

There were, for starters, the countless hours on the road, driving back and forth from Williamsburg to Washington to panhandle among the political action committees in the capital. The PACs are essential in financing any congressional campaign these days and Grayson estimated he must have seen more than 50 of them during his two month ordeal--the Steelworkers PAC, the Machinists PAC, the National Education Association PAC, the Communication Workers PAC, the Solar PAC, the Sierra Club PAC--and on and on the list went. One visit was rarely enough.

"These people are beset by scores of candidates," he said. "So you have to keep your name and face uppermost in their minds. They're busy people."

As arduous as PAC hunting was, it was nothing compared to the distaste of fund-raising back home, where he would call local businessmen he barely knew and plead for contributions.

"It was the notion of imposing on people for money," he said. "I felt their reaction to me was the same as when I'm in my own home and the phone rings and it's somebody trying to sell me something."

On top of it all, there were the 18-hour days to keep up with a frantic schedule of campaign rallies, union hall meetings, speeches and strategy sessions. Sure, he might have been elected, but what kind of life would he have had to look forward to?

"I wasn't unaware of the pressures of Washington life," he said. "As a freshman or sophomore congressman, you would have to be back in the district every week and in this district, because of its proximity to Washington, it would probably be a couple of times a week. So it wasn't just 19 more weeks until the end of the campaign. It was going to be 104 more weeks if I was elected."

Grayson said he never really had a burning ambition to be in Congress. A soft-spoken and thoughtful man, he is by training an academic whose first loves are international and Latin American studies. He is a political liberal, cast in the Adlai Stevenson mold, who said he was horrified by the Reagan administration. He only decided to undertake the race last April, he said, because no other leading Democrat wanted it. He feared Trible's seat would then go to the staunchly conservative Bateman, with whom Grayson had frequently tangled in the legislature on environmental issues.

"It was a distaste for the Reagan policies," he said. "I thought, 'We can't let this seat go by default to someone who's going to be drum major for Reaganomics' "

Grayson's troubles began about mid-May. He found himself lying awake into the early hours of the morning, worrying about the design of a campaign brochure or the content of a press release or, most of all, about the money. He went to his doctor and asked "for the lightest medication in your book." The doctor prescribed a mild sleeping pill and he began taking half of a tablet a night. He found that would put him to sleep until about 3 a.m., when he would wake up again and the worries would begin anew. Soon, he was taking a full tablet.

Within a week, he went back to the doctor, who prescribed the tranquilizers. He had never taken drugs before, Grayson said. But now his days were starting with tranquilizers and ending with sleeping pills. Still, he couldn't sleep.

Last weekend, Grayson and his wife drove his 11-year-old daughter to summer camp in North Carolina. For two days, he was alone with his family in the Blue Ridge mountains of North Carolina, far removed from the anxieties of his campaign.

"I thought that two days in the Blue Ridge ought to cure anybody of insomnia," Grayson said. But when he returned Monday "all the worries and anxieties were still there." He knew then that his campaign for Congress was over.

After she found that her husband had quit his campaign, Carmen Grayson said she joyously threw out his medication. "The burden has been lifted," she said. Grayson, though, is more cautious, keenly aware that he has let down his friends and his party.

"Well, let's just say the burden is lifting," he said. "But I slept reasonably well last night without taking anything."