you probably used the screen transfer function to adjust the histogram. by default, XISF can save the state of the STF on the image, leading to the impression that your stretch was permanent when you close and re-open the XISF.
or, it could be that you applied an STF, then applied some real histogram changes on top of that (using the HistogramTransformation or Curves tool), but those changes are not significant compared to the STF, so what gets written out to jpeg or tiff does not look right.
STF is just to make linear data visible on the screen - it does not change the underlying data.
is there a green bar along the left side tab showing the name of the image? that's the indicator that the STF is on.
rob