Actually, I don’t think that anybody has ever counted them.Mathematically: 21,952 roots. Practically, you get 6,332 roots.
There are many Arabic dictionaries. Hans Wehr‘s Arabisches Wörterbuch für die Schriftsprache der Gegenwart (named after a German scholar, published in 1952) is the most complete dictionary of Standard Arabic ever published in the West. It contains 2967 roots (جِذْر) with 3 letters and 362 with 4 letters.
The most famous dictionary of Classical Arabic is Lisān al-‘Arab (لِسان الْعَرَب), compiled by Ibn Manzūr (ابْن مَنْظُور) in the early 14th century (711 AH). It contains around 80,000 entries and in total (3 + 4 letters + foreign words) 9273 roots.
Since the Arabic alphabet consists of 28 letters (consonant phonemes) there are 21,952 theoretical combinations (=283) of roots with three radicals. However, certain combinations are impossible (with few exceptions):
There is no Arabic root which consists of three identical consonants.
There are no Arabic roots with identical consonants in the first and second position.
There are no Arabic roots with identical consonants in the first and third position.
However, there are roots whose second and third letter are identical, for example, to pass (م–ر–ر).
Taking into account all possible restrictions, the theoretical number of all possible combinations of roots (morphemes) with three letters is 6332.
Remark: What are the most common root letters? In Hans Wehr, the most common root letter is ر (722 times). The ظ is the least common: only 42 times (1.4 %). The ن is the most common first radical (235 times).