As is the case with light traveling through any medium, radio waves traveling through space experience refraction, which reduces their speed. A wave of infinite frequency will experience no refraction, meaning that we can compute how much a given wave will be delayed compared to such an infinite-frequency wave as it moves through outer space. The group velocity of a radio wave is determined by $v_g=c\mu$, with $\mu$ the refractive index defined by
$$\mu=\sqrt{1-\left(\frac{\nu_p}{\nu}\right)^2}$$
with $\nu$ the frequency of the wave and $\nu_p$ the plasma frequency, a fundamental property of the medium, which depends on its density:
$$\nu_p=\sqrt{\frac{e^2n_e}{\pi m_e}}$$
with $e$, $m_e$ and $n_e$ the charge, mass and number density of electrons. (You're probably more familiar with refractive indices for light that humans can see, but they're important in a much wider portion of the electromagnetic spectrum!) In the ISM, we'd expect to see plasma frequencies in the kilohertz range - much lower than the frequencies of radio waves from whatever source we're observing, which are likely in the hundreds of megahertz to tens of gigahertz range. The delay a wave of frequency $\nu$ experiences over a distance $d$ is
$$t(\nu)=\int_0^d\frac{dl}{v_g}-\frac{d}{c}$$
where the second term requires no integral as the refractive index of a wave of infinite frequency is always $\mu=1$ regardless of the medium. We can use a binomial approximation for the refractive index of our physical finite-frequency wave, since $\nu\gg\nu_p$, and after some algebra, we find that
$$t(\nu)=\frac{1}{c}\int_0^d\left(1+\frac{\nu_p^2}{2\nu^2}\right)dl-\frac{d}{c}=\frac{e^2}{2\pi m_ec}\frac{1}{\nu^2}\int_0^dn_edl$$
Now consider two waves of frequencies $\nu_1$ and $\nu_2$. The difference in arrival times is
$$
\begin{aligned}t(\nu_1)-t(\nu_2)&=\frac{e^2}{2\pi m_ec}\frac{1}{\nu_1^2}\int_0^dn_edl-\frac{e^2}{2\pi m_ec}\frac{1}{\nu_1^2}\int_0^dn_edl\\
&=\frac{e^2}{2\pi m_ec}\left(\int_0^dn_edl\right)\left[\frac{1}{\nu_1^2}-\frac{1}{\nu_2^2}\right]
\end{aligned}$$
If we define the dispersion measure by
$$\text{DM}\equiv\int_0^dn_edl$$
and define it in units of $\text{cm}^{-3}\;\text{pc}$, write the chunk of constants in front in units of $\text{GHz}^2\;\text{pc}^{-1}\;\text{cm}^3\;\text{ms}$:
$$\frac{e^2}{2\pi m_ec}=4.15\;\text{GHz}^2\;\text{pc}^{-1}\;\text{cm}^3\;\text{ms}$$
and write out frequencies in units of $\text{GHz}$, then we indeed recover the expression you give - with the time delay in units of milliseconds. It would be a lot clearer if we rewrote it as
$$t_1-t_2=4.15\left(\frac{\text{DM}}{\text{cm}^{-3}\;\text{pc}}\right)\left[\left(\frac{\nu_1}{\text{GHz}}\right)^{-2}-\left(\frac{\nu_2}{\text{GHz}}\right)^{-2}\right]\;\text{ms}$$
which has the proper units.
In short: If you write your frequencies in gigahertz and your dispersion measure in parsecs per cubic centimeter, the formula will give you a time delay in milliseconds.