The regularity with which you wash your hair depends entirely on its length, natural texture and the sorts of things you put it through on a daily basis. If you’ve got medium length hair and you’re at the gym every day, it’s worth washing out all that grime once a day.
On the other hand, if you’ve chemically treated your hair, it’s probably best to hold back on shampooing as you don’t want to dry it out any more than is necessary. Weirdly, the less you wash your hair, the less oily your scalp will produce.