The New York Times asked a federal court in Newark yesterday to free its reporter, M.A. Farber, from a New Jersey jail on grounds that the state courts have denied him his right to a speedy hearing.

U.S. District Court Judge Frederick Lacey set a hearing for Friday on the Times's motion to free Farber on a writ of habea corpus but refused to let him out on bail until then, Farber has been in jail since last Friday for refusing to turn over his notes on a murder investigation to New Jersey Superior Court Judge William J. Arnold.

Arnold jailed Farber and fined the Times $5,000 a day until the files are made available to him. They were subpoenaed by the defense attorney for Dr. Mario W. Jascalevich, who is charged with murdering three patients in 1965 and 1966 at Riverdell Hospital in Oradell, N.J., with doses of curare.

Although New Jersey has a strong press shield law that The Times contends protects Farber from being forced to turn over his notes to either a judge or a defense attorney, Arnold has demanded the right to see for himself if they would aid Jascalevich in the murder trial.

The case has bounced from one court to another during the past two weeks, and two U.S. Supreme Court justices have refused to stay Arnold's contempt order. No hearing has been held by New Jersey's appeals court on the merit of The Times's argument that Arnold exceeded his authority by demanding to see Farber's notes.

The Times has also argued - but has not been able to make this case before a court - that the subpoena for the notes is so broad as to involve thousands of pieces of paper. The first hearing on the appeal is set by the New Jersey courts for Sept. 18.

In order to get the federal court to free Farber until then. The Times's attorneys will have to show Judge Lacey that they have exhausted all their remedies within the state court system.

Earlier, Assistant Attorney General Philip B. Heymann, who heads the Justice Department's criminal division, said he does not believe anyone should be thrown into jail for contempt of court without having a chance to appeal the judge's ruling.

He made his comments during a panel discussion at the American Bar Association's annual meeting here on the current debate among lawyers, judges, and journalists over how much protection the First Amendment's guarantee of freedom of the press gives reporters who want to keep their sources secret.

While New York Times executive Editor A. M. Rosenthal, for instance, asserted that forcing reporters such as Farber to turn their notes over to the court would cripple their ability to uncover wrongdoing, former New Jersey governor Robert E. Meyner accused journalists of trying to make their rights "supreme over and above the right to a fair trial."

Rosenthal, though, said both are possible.

He said attorneys use the issue of confidentiality of a reporter's sources as a strategic weapon in trials in an attempt to weaken an opponent's case or strengthen their own. Judges, Rosenthal continued, don't make them prove they have "an absolute need" to put a reporter on the witness stand or use notes or news photos as evidence.

"I think it's time that the lawyers - the bench and the bar - gave a hell of a lot more thought to the political, social, and journalistic consequences of these confrontations led by participated in, and acquiesced to by the bar," said Rosenthal.

"The press and bench and bar may be adversaries," he added," but we live in the same society."

He and CBS News President Richard Salant agreed that the ability of journalists to do their job is hampered by fears that they will be forced by the courts to reveal their sources who, Cabinet members blowing the whistle on official wrongdoing or a two-star general telling about the misdeeds of a sick superior as a sleazy underworld stoolie reporting on police corruption.

Without the use of sources, he said, the Washington Post would not have been able to force full investigation of Watergate, and The New York Times would not have been able to expose the illegal activities of the Central Intelligence Agency in this country.