The answer is... that there's no right answer. Everyone's hair and scalp are different. In general, you should wash it whenever you start to feel uncomfortable with it—that simple. Some people are happy going a week or two between shampoos, some people do it every day, some people are completely anti-washing and just use natural rinses instead. If you have fine, oily hair, you're probably going to be washing a few times a week—or using dry shampoo pretty liberally, which is not at all a bad thing (Alterna Cleanse Extend Translucent Dry Shampoo is a good one for any hair color or type).
If your hair is naturally dry or coarse, shampooing too much will only cause frizz and lead to breakage, so instead of thinking about “needing' to shampoo just because, try viewing you hair in terms of its overall health and happiness, and when you do wash, use something gentle like Free Your Mane Sulfate Free Hydrating Shampoo.