A federal judge yesterday ordered that an upcoming report on the mental condition of presidential assailant John W. Hinckley Jr. be sealed from public disclosure.

Officials at St. Elizabeths Hospital, where Hinckley has been confined since he was found not guilty by reason of insanity of the attempted assassination of President Reagan, are due to file the report in U.S. District Court by Aug. 2. It is expected to contain the hospital officials' assessment of Hinckley's current mental state and their determination as to whether he is a danger to himself or others.

Judge Barrington D. Parker has scheduled a court hearing for Aug. 9 to determine, based on the hospital's report, whether Hinckley should be released from custody or whether he should remain committed to the hospital because he is still dangerous.

In a brief order yesterday, Parker, without explanation, ordered the hospital to file its report under seal with the clerk of the court.

Hinckley himself has said, in a telephone conversation with The Washington Post, that if the hospital's report on him is "very negative," he may waive his right to the Aug. 9 hearing. However, he has also said that he will seek release if the hospital says he is well.

Following the verdict in his case, Hinckley's parents and lawyers said they would not seek his release from St. Elizabeths unless they were convinced that he was no longer a danger to himself or others.

If Parker decides on Aug. 9 to keep Hinckley at St. Elizabeths, Hinckley could seek a court hearing every six months thereafter at which he could try to prove that he is no longer dangerous and should be released from custody. Any decision on Hinckley's release would be up to Parker.