Apparently a long time. I don't know anything about the chemical involved. You'd need to understand how it reacts to heat and other chemicals to know how stable it might be.
What we can say is that some chemicals (calcium carbonate for example) are very stable under pretty common conditions and others (DNA for example) only moderately stable for a much shorter period of time while still others aren't going to last days even. Where heme falls in this range I don't know other than there are some suggesting that it can hang together for 10's of millions of years.