Iwao Hakamada is the person who has been on death row the longest in the world (46 years).

But it ultimately went in his favor, as he was eventually acquitted and released.

en.wikipedia.org/wiki/Iwao_Hak