THE PSYCHOLOGISTS cheered when Ed Koch got up to speak last week. The New York City mayor, who addressed a meeting of the American Psychological Association, drew support from mental health professionals when he spoke about the need to care for the homeless mentally ill, who in many cases have been released from institutions. The mayor's exasperation with those who believe that people who cannot take care of themselves should remain "free" on the streets was shared by psychologists who believe that deinstitutionalization has been, in many respects, a failure. Psychiatrists and other experts have expressed similar views.

In the early 1960s, there were about 90,000 mental patients in New York state institutions. Now there are 20,000. The movement out of hospitals was sparked by the development of drug therapy and by the drive to establish small, community-based residential facilities to care for the mentally ill. But sufficient money and resources were never made available, and now thousands of patients remain homeless with no supervision or support in the community.

Mayor Koch, in his usual style, has referred to those who would continue this situation as the real "loonies" and "crazies." But while this kind of hyperbole is always good for a few laughs, the let-them-go-free argument is not the essential problem at this stage. There is widespread support for taking into custody those street people who would freeze without shelter or whose health would be threatened by inadequate food or sanitation facilities. Lifesaving care must be given even if the recipient objects to being helped. The real problem is whether the city and the state -- and this city too -- have the resources to deal with these needs.

Mentally ill patients are sometimes kept for more than 24 hours waiting to be treated in New York's Bellevue Hospital emergency room. Short-term care must then be provided by the city and long-term placement, if necessary, by the state. At this time, neither has the beds, facilities or personnel to handle the probable demand. How many cities do? And what is being done to prepare to meet needs that always increase in winter and that are now exacerbated by policy changes which everyone knows must be made? Mayor Koch has the right idea. He also has the support of professionals and citizens. But will funds be provided to back up the new policies? Will this community be ready to meet the test?