There are two popular interpretations of dreaming that your hair is going gray or white. The first is that you're afraid of ageing, and the second is that you're becoming wiser.
Gray Or White Hair As A Fear Of Ageing
This interpretation is fairly self-explanatory; as we get older, our hair loses its color pigments and turns white. If you dream of this happening - or have a nightmare, even - it could represent your fear of growing older. This doesn't mean that it's going to happen to you any time soon, but it can symbolise an aversion to ageing. This could even be a fear of the transition from adolescence to adulthood and the responsibilities that come with it - it doesn't necessarily show a fear of being very old!
Gray Or White Hair As A Symbol Of Wisdom
This explanation is perhaps more pleasant, and implies that you're maturing and becoming more knowledgeable in the ways of the world. Maybe you've realised something important recently, or have discovered something about yourself that you didn't know before. Either way, it can symbolise spiritual growth, which is definitely not a bad thing.