First of all, $T$ must have order zero, i.e., $|T(\varphi)|\le C(K)\sup|\varphi|$ for any test function $\varphi$ supported on a compact set $K$. By Riesz representation theorem, $T$ is a measure. To be a locally integrable function, it must be absolutely continuous with respect to the Lebesgue measure. One way to express this condition: $C(K)\to 0$ as the Lebesgue measure of $K$ tends to zero, which $K$ staying within a fixed compact set.