It means to change slowly and is used to describe who is stubbornly resistant to change. Acvording to the Oxford Dictionary of Idioms, it was quoted in 1784 as a 'Tyburn phrase' - ie used to describe criminals to died resisting to the last on the Tyburn gallows in London.
The 1811 'Dictionary of the Vulgar Tongue' puts a slightly different slant on it. "Die hard, or die game... Not to shew fear or contrition at the gallows... to protect the honour of the gang," suggesting coolness at the impending rope, rather than struggle.