Arkham Asylum is located on the outskirts of Gotham City and is where those of Batman's foes considered to be legally insane are incarcerated (other foes are incarcerated at Blackgate Penitentiary).
Arkham Asylum does not have a good record, at least with regard to the high profile cases - inmates such as the Joker are frequently shown escaping at will - and those who are 'cured' and released tend to re-offend.
In addition, prisoners with unusual medical conditions that prevent them from staying in a regular prison are housed in Arkham. For example, Mr. Freeze is not always depicted as insane, but he requires a strongly refrigerated environment to stay alive; Arkham, with special conditions required for certain patients or inmates being a regularity rather than exception, is potentially seen by authorities to be an ideal location under certain circumstances.
Gotham criminals deemed "criminally insane" or "mentally unfit" by the court of law generally are treated at Williams Medical Center before being deemed dangerous enough to be sent to Arkham Asylum.