
Simon W. answered 11/06/19
Capable and Enthusiastic Language and Linguistics Tutor
I have a Master's degree in Linguistics and have studied Arabic linguistics and writing systems extensively, and this is a fantastic question!
Speakers of many, many languages use (or have used) the (Perso-)Arabic script to represent their speech in writing. As far as an exhaustive list, that's not something I can provide offhand, but the Wikipedia page on the the writing system contains a generally well-cited list of dozens of languages (https://en.wikipedia.org/wiki/Arabic_script#Current_use) that use it today and still more (https://en.wikipedia.org/wiki/Arabic_script#Former_use) that have used it at some point in the past.
How the script works with languages other than Arabic can get a little complicated. First, it is important to keep in mind that writing systems do not exist independently of the languages that they represent—speakers want the system to be specific enough to be accurate but simple enough to be easily readable, so the form of the language itself has some influence on the form of the writing system. However, this relationship is complex and often fraught with difficult historical and cultural context. Arabic works very well for writing Arabic (of course!) but often not as well for other languages it is used for. For this reason, it is common for modifications to be made based on the sound system (phonology) of the language being written. Additional dots/points/nuqqaT may be added in various places along with lines, bars, or rings through parts of the letters. Some of the languages may have a glottal stop in their collection of sounds, but others may not—but they may still use the 'alif and hamza to represent a vowel or other sound. Some languages (like Persian/Farsi) use no short vowel symbols, but others (like Uyghur) require them at all times.
Importantly, a language's use of the script cannot be taken as an indicator of a familial relationship between that language and Arabic. Many language communities came into contact with the Arabic writing system through reading the Qur'aan and the as Islam spread, so did the Arabic script. In fact, the great majority of the languages that make use of the script are not closely related to Arabic at linguistically and therefore, may share little to no grammar or word order. As I mentioned before, though, the language communities who do or did use the Arabic writing system often have a large Muslim population and/or a history of interacting with Islamic world powers, which commonly leads to a high proportion of loan words from Arabic (e.g., kitab 'book' in Swahili, or jawab 'answer' in Indonesian*). Sometimes these words take the place of an indigenous word, and in other cases the two terms can co-exist peacefully.
I hope that is some helpful context for your great question!
*Both of these languages have used the Arabic script irregularly/in the past, but generally do not today.