Actually it was stated in ch. 9 when the human came to their town and they ate meat with Rimaru. He was touching the hot plate used for cooking the meat, the girl mentions that he's touching the hot plate and was wondering if he was okay.
Which he is an then he asks Great Sage and Great Sage says that he has resistance to hot and cold and he figures its because when he was stabbed he felt hot and cold from blood loss so when he transferred he gained resistance... so technically he had this ability since the beginning, but didn't know about it till ch. 9
When did he gets the resistance to fire ? I can't remember... Σ(  ̄□ ̄)