Indeed, わかる is mostly written in kana.
Corpus data gives the following proportions:
わかる 58280 71%
分かる 17700 22%
解る 2964 4%
判る 2580 3%
A priori there seems to be no reason not to use the kanji as わ・かる is a jōyō reading of 分 (taught already in the second year of primary school).
Indeed, this publisher explains that for their primary school books, they use 分かる applying the principle "use kanji you have learned wherever you can". However, their secondary school books use わかる whenever the intended meaning is "to understand/realize", since in this sense 解る or 判る might be more suited, but these readings are not official jōyō readings. They explain that many dictionaries associate 分かる to 「はっきりしていなかったことに区別がつく」 — an English equivalent might be "to differentiate" — which is close in meaning to other readings of 分 such as 分ける "to divide".
(Of course, the meaning of "understand" derives from "differentiate" and you are free to choose to write both in kanji as 分かる without raising too many eyebrows. The above just gives some numbers/reasons showing that and explaining why わかる might be chosen over 分かる.)