Alleged Washington heroin kingpin Linwood Gray bought three houses, a nightclub and five cars over the last three years with "enormous" profits from bank robberies he committed in the 1960s, his lawyer told a federal jury here yesterday.

Describing Gray as someone who "believes he's a gangster . . . like Al Capone," defense lawyer Kenneth Michael Robinson declared that his client had nothing to do with the massive international heroin smuggling ring that federal prosecutors say he masterminded and netted him thousands of dollars from mid-1976 until his arrest Jan. 23.

Gray "was perhaps one of the most notorious bank robbers in the history of the District of Columbia," Robinson told the nine-woman, three-man U. S. District Court jury in his opening statement. The defense lawyer said that while Gray spent six years as a mental patient at St. Elizabeths Hospital, he stashed away between $300,000 and $315000 from the 1960s bank robberies, including some money that he hid in frozen chickens. In the 1960s, Gray was convicted of robbery, but cleared of other charges when he was found not guilty by reason of insanity.

While the government's chief prosecutor, Assistant U. S. Attorney Barry L. Leibowitz, portrayed Grays asthe chieftain of the heroin smuggling operation and methodically detailed the 56 counts against Gray and 11 codefendants in a 47-page indictment, Robinson attempted to show that Gray was mistakenly cast as the villain in the plot. Other people actually led the drug importation scheme, he argued.

Robinson said that the ringleader in the heroin scheme was Warren Christopher Robinson, a heroin wholesaler here in the early 1970s who now is serving a long prison term for his drug operations.

But the defense lawyer also alleged that Warren Robinson's key lieutenants in the drug operation included one of Gray's codefendants, Robert L. Stuckey, as well as Bob (Nighthawk) Terry, a one-time Washington soul music disc jockey who disappeared in August 1977, and an Oxon Hill attorney named Howard L. Stern, who in the past has represented Gray and Warren Robinson.

Defense lawyer Robinson told the jury at one point that "we're going to show you that Nighthawk Terry was doing a lot more than peddling records for WHUR."

Reached at his office, Stern said he is "absolutely not" involved in any drug smuggling operation. But he said Leibowitz notified him that he is a "target" in the Gray drug investigation. He was not indicted in the current case.

Defense lawyer Robinson said that Terry disappeared several weeks after he, Gray, Stern and Stuckey promoted a rock concert in Calvert County, Md., on July 4, 1977. Robinson said that Gray only became a target of the drug smuggling operation after investigators learned that Gray had a 5 percent interest in the rock concert and surmised that he must have gotten the money for the promotion from drugs.

There are widely varying reports on how much money was raised at the concert, with Robinson saying that the performance grossed $2 million, while Stern said the figure was about $200,000.

In any event, Stern said, "the Nighthawk disappeared before we had a final accounting."

Whatever the facts of the 1977 rock concert, attorney Robinson said he would prove that Gray's involvement in it and other financial investments didn't "have one thing to do with drugs."

Shortly before Gray's arrest, Robinson said that his client became aware through newspaper stories that he was a target of the heroin investigation. In one surreptitiously taped conversation, Gray allegedly discussed paying a goverment informant, Joseph Sorrell, as much as $31,000, which prosecutors allege was another payment to Sorrell, for being a heroin courier from Amsterdam to Washington.

Robinson said that the payment was discussed because Gray thought he was buying from Sorrell information on Nighthawk Terry's whereabouts. The defense lawyer said that Gray and a codefendant, accused Gray lieutenant Joseph F. Wilson, planned to tell Leibowitz of Terry's alleged involvement in drug running.

Leibowitz, who was shot and slightly wounded by an unknown assailant at was hot and slightly wounded by an unknown assailant at the height of the drug investigation last Dec. 20 as he walked into the federal courthouse here, gave the jury an entirely different version of the alleged Gray ring.

The prosecutor said that, under Gray's leadership, numerous couriers were sent to Amsterdam where heroin was substituted for tobacco in Marlboro cigarettes. The packets were than smuggled back into the United States in bags that looked like they contained cigarettes purchased in duty-free shops and were thus not subject to inspection at U.S. customs checkpoints.

Leibowitz said that two of the chief couriers, Sorrell and Ernest Fletcher, will testify for the government about their participation in the drug operation. Investigators have said that $30 million of extraordinarily high-quality heroin was smuggled from the opium fields of Southeast Asia to the streets of Washington as part of the scheme.

The prosecutor said that the couriers were paid thousands of dollars for their work and that Sorrell and his wife started their participation on what was nominally their honeymoon.

Leibowitz described Gray as a tough taskmaster who, for instance, upbraided his aides when he thought they were not bringing enough heroin back for the amount of money he sent with them to amsterdam or when they botched and assignment.

Leibowitz said that at one point Gray accused one courier, the late Ernest H. Minder, of gambling away the heroin profits at European casinos and told him "he wasn't being a good businessman.

The smuggling operation was discovered when defendant George F. Carter III was arrested in Chicago as he tried to get past customs with the heroin in the cigarettes. Leibowitz said that after that more heroin was smuggled inside girdles worn by couriers.

The prosecutor alleged that Gray and other persons charged in the operation paid cash in $10 and $20 bills reaped from the drug sale profits to buy houses and cars, usually Cadillacs. In one instance, Leibowitz said that Gray paid $55,000 in cash to buy a house and then later another $25,000 in cash to a contractor to build and extension onto the house.

"Everytime he bought a house he paid cash," Leibowitz said as he pretended to peel cash out of his hands. CAPTION: Picture, LINWOOD GRAY . . . convicted of bank robbery