Using the duality property, I guess it happens whenever the original signal is composed of a sum of dirac delta functions spaced at equal intervals of time.
I conclude this as the Fourier transform of a periodic function is a number of dirac delta functions (of size $2\pi a_k$) at intervals of $\frac{2\pi k}{T}$ What is the actual condition?
You are right. A periodic Fourier transform can be written as a Fourier series:
$$F(\omega)=\sum_kc_ke^{i2\pi k\omega/\omega_0}\tag{1}$$
where $\omega_0$ is the period. Taking the inverse transform of $(1)$ we get
$$f(t)=\mathcal{F}^{-1}\{F(\omega)\}=\sum_kc_k\mathcal{F}^{-1}\{e^{i2\pi k\omega/\omega_0}\}=\sum_kc_k\delta\left(t+\frac{2\pi k}{\omega_0}\right)\tag{2}$$