When should a tensors gradients be detached?

I understand how detaching gradients from tensors work. However, I do not know when to do this. When looking at a research paper, how do you know which variables to let gradients flow through? an example from an RL paper(say DDPG https://arxiv.org/pdf/1509.02971.pdf ) might be helpful.