President Reagan named a 20-member commission on organized crime yesterday and promptly found his attorney general exchanging shots with Congress about crime on Capitol Hill.

In signing an executive order creating the commission, the president said it is time to "break the power of the mob in America," which he said "infects every part of our society."

Before he spoke, Attorney General William French Smith set off a rhubarb in defending the president's recent dealings with the International Longshoremen's Association and the Teamsters, saying that Reagan would not be able to deal with Congress if he had to avoid all convicted criminals.

Smith had been asked why the president recently attended an ILA convention and embraced its leaders.

"If the suggestion here is that we should boycott an organization because there may be individuals connected with that organization who have been convicted of some criminal activity," Smith said, "if that is the suggestion, it has remarkable ramifications because I assume, based on what has recently happened, there might be circumstances under which we would then have to terminate our relationships with Congress."

On the Senate floor, Minority Leader Robert C. Byrd (D-W.Va.) asked the attorney general to withdraw his comments.

"I am shocked by that kind of statement and I think he should put up or shut up," said Byrd.

Sens. Sam Nunn (D-Ga.) and Joseph R. Biden Jr. (D-Del.) said in a statement that criminal activities by leaders of the Teamsters and ILA "are well documented," and demanded proof of criminal activity by leaders of the Congress.

"The attorney general should disclose what information, if any, he has indicating criminal activities by the 'leaders' of Congress," who are generally recognized to be Byrd and Sen. Howard H. Baker Jr. (R-Tenn.) and Reps. Thomas P. (Tip) O'Neill Jr. (D-Mass.), James C. Wright Jr. (D-Tex.) and Robert H. Michel (R-Ill.), they said. "If he has no such information or charges against the leaders of Congress, then he should retract his statement and immediately apologize."

In the Rose Garden ceremony with Smith, FBI Director William H. Webster, Vice President Bush, who is the head of the federal drug task force, and members of the commission, the president said that some may feel that the commission will only duplicate current law enforcement efforts.

Reagan said that the commission "can moblize the American people against organized crime." By conducting public hearings, he said, it will undertake "a region-by-region exposure and analysis of organized crime, to measure its influence and impact on American society, and make judicial and legislative recommendations."

Reagan said that he would ask Congress to give the commission subpoena power for its investigations.

To head the commission, the president named U.S. Circuit Court Judge Irving R. Kaufman, 73, of New York, who sentenced Julius and Ethel Rosenberg to death for espionage in 1953 and who gained a reputation for a hard-boiled attitude in 1960, when he gave several long sentences to mob leaders arrested during the so-called Apalachin crime convention in upstate New York.

Also on the commission are Sen. Strom Thurmond (R-S.C.), chairman of the Senate Judiciary Committee; Rep. Peter W. Rodino Jr. (D-N.J), chairman of the House Judiciary Committee, former Supreme Court justice Potter Stewart and law-enforcement officials and lawyers from across the country.