Considering you have a generous time for the overall trip (4-5 weeks) I too agree that a week is about right.
One thing I disagree with is the suggestion to divide your time in Istanbul--I personally think you should keep it all together at the end of your visit. Particularly on your first visit to Turkey, I can't imagine a worse place for an independent traveler to recover from significant jet lag than Istanbul!
While I only spent a small amount of my life living in a large city, I'm no stranger to large cities throughout the world. I've visited Istanbul many times now and despite spending more than a month in total, it still somewhat overwhelms me with both its size and general pace. While we have made a number of excellent friends in Turkey (with a few of them living in Istanbul) none were actually met in Istanbul. I find it significantly more difficult to have meaningful interactions with Turkish people in Istanbul than nearly anywhere else in the country. Even some Turkish friends who moved to Istanbul more than a year ago say it is FAR more difficult for them to make friends in Istanbul than other places in the country. This isn't because people in Istanbul are any less friendly, it's because they're so busy! Even with weeks of advance notice it can be difficult to meet with friends in Istanbul for just a few hours! This seems to apply to people of every strata of life as our friends in Istanbul are of wildly different means, occupation, etc. Actually anyone who isn't very busy in Istanbul probably is not the sort of person you need to be interacting with ;)
As Sarikinarya said, if you split your time in Istanbul you may well get a different impression during the second visit. I go a bit farther and say that your second impression will probably be significantly better than the first. That makes me conclude, "Why bother with the first (and likely false) impression?"