The longest contempt detention I'm aware of was a very bizarre case involving a guy named Richard Fine who was jailed for something less than 18 months. It was a civil case, and as far as I know he never argued that the information he was being ordered to produce would incriminate him in a criminal matter. His attempts to secure his release involved some conspiracy-theory-level ranting that probably contributed greatly to higher courts ignoring him.
A local judge ultimately decided Fine was irrational and keeping him in jail didn't accomplish anything but taking up of jail space and resources.
In a criminal matter involving even a hint of self-incrimination, I'm disinclined to think a contempt sentence would be allowed to continue indefinitely by US courts absent an immunity deal.