Mentally challenged people were normally sent to St Mungo's Hospital for Magical Maladies and Injuries. There are two instance I can think of in the books.
Gilderoy Lockhart after his training:
“Oh, my goodness," said Hermione suddenly, sounding breathless. "Professor Lockhart!"
Their ex-Defence Against the Dark Arts teacher pushed open the doors and moved towards them, wearing a long lilac dressing gown.
"Well, hello there!" he said. "I expect you'd like my autograph, would you?'
"Hasn't changed much, has he?" Harry “muttered to Ginny, who grinned.
"Er — how are you, Professor?" said Ron, sounding slightly guilty. It had been Ron's malfunctioning wand that had damaged Professor Lockhart's memory so badly that he had landed in St Mungo's in the first place, though as Lockhart had been attempting to permanently wipe Harry and Ron's memories at the time, Harrys sympathy was limited.
Harry Potter and the Order of the Phoenix, Chapter 23 - Christmas on the Closed Ward
Ariana Dumbledore before training:
“And my father went after the bastards that did it,” said Aberforth, "and attacked them. And they locked him up in Azkaban for it. He never said why he'd done it, because the Ministry had known what Ariana had become, she'd have been locked up in St. Mungo's for good. They'd have seen her as a serious threat to the International Statute of Secrecy, unbalanced like she was, with magic exploding out of her at moments when she couldn't keep it in any longer.”
Harry Potter and the Deathly Hallows, Chapter 28, The Missing Mirror
Because of the International Statute of Secrecy, mentally challenged people are sent to St Mungo's Hospital for Magical Maladies and Injuries.