If you mean on one project, you can wear as many as you can handle. The challenge is to do every job well, and when you wear too many hats, the one hat that you want to "excel" at, may backfire on you.
When I've produced shows that I've acted in, I've never been able to do 100% of the work on my acting that I do when I'm just acting. It's no fun to produce a show in order to be seen as an actor and then have the end result be something that falls short of your true talent.
Now, if you mean in general, you can wear as many hats as you want in the industry, BUT and this is a big but, do not mix your "hats" on your marketing materials. It's one thing to be a writer/director, but an actor who writes should have separate business cards for each, as should a DP/Producer. When people start seeing a list of what you can do on your cards and resumes, they figure you're not a specialist in one area.
To stay current on The Greenlight Coach's speaking engagements, recommendations, and work success articles, sign up for her free newsletter at the top of the page and get a great bonus 1-hour MP3 on creating powerful business partnerships when you do!