When you have grease and/or dirt in your hair that you want to wash out it's best to use hot water for getting the grease and dirt out of your hair.
But for just washing and rinsing your hair you should use cold water to wash your hair since the cold water will prevent fizz of your hair and shine and seal in moisture to your hair.
If you're trying to detangle or condition your hair you should use warm water but avoid getting the water too hot as it may burn your scalp.