Are you allowed to say lashon hara on a dead person? And is there any time when a person can say lashon hara?
The Gemara cites a dispute concerning saying lashon hara on the dead. One opinion maintains that the dead don’t care anymore, whereas the other states that this remains prohibited. Certainly, one must beware of speaking lashon hara on a Torah scholar who passed away, on account of the honor of his Torah. See Chafetz Chaim 8:9, who cites an enactment not to speak lashon hara on the dead at all.
It is permitted to speak lashon hara where this is necessary, and there is no other way of achieving the result–for example, in clarifications for a shidduch, and similar matters.