Artificial intelligence is a huge part of the healthcare industry, having applications and uses in oncology, cardiology, dermatology, and many other fields. Another area where AI is constantly attempting to improve is mental healthcare by integrating machine learning to evaluate data generated by mobile and IoT devices. AI aids in the diagnosis and tailoring of therapy for mentally ill individuals at various stages. The artificial intelligence and machine learning methods utilize electronic health records, mood rating scales, brain images, mobile devices monitoring data in prediction, classification, and grouping of mental health issues, mainly psychiatric illness, suicide attempts, schizophrenia, and depression. The goal of this chapter is to review the literature on artificial intelligence and machine learning algorithms for detecting a person's mental health by utilizing patient health records. In addition, the chapter explains the use of artificial intelligence in curing and monitoring a patient with mental illness through telemedicine.