On the Team Liquid forum, there was some research done about this. The research was done in 2010 for Wings of Liberty, but should still be mostly valid.
User Fork posted some replays with math in this thread, and came to these conclusions:
- It is better to place turrets next to the CC, not by the minerals.
- Placing turrets in your mineral line may lower income by ~6% (50 minerals/minute out of 700-800; this is equivalent to the loss of one worker)
- Surprisingly, scooting your CC back 1 space and then building the turrets diminishes the income penalty (However, the income loss from lifting off and re-landing was not accounted for).
Also, here is another thread (also from 2010) which backs up point #1: Even up to 3 buildings placed next to a Nexus had minimal effect on gathering rate (!50 minerals/minute, about the cost of one worker).