How much you rotate depends largely upon how much you need to rotate in order to reach your opponent.
The ideal range would allow you to rotate beyond square - or 90 degrees - to approximately 135 degrees, as the greater the rotation, the greater the potential force of your punch. This also allows helps you achieve the boxing ideal of 'hitting without being hit', as you maximise your distance from your opponent.
Incorporate torso rotation into almost every punch, rather than relying upon the much weaker combination of shoulder and arm muscles alone. Even a slight twist, when performed correctly, will add considerable force to your strikes. Although torso rotation may seem less important when throwing feints and soft, distracting shots, consistency of torso/shoulder rotation will make various punches harder to read.
Avoid leaning forward to reach your opponent. Rely instead on torso rotation. If you lean forward, you place too much weight upon your front foot which reduces your ability to regain a defensively responsible stance and leaves your head very vulnerable to counters. Using rotation to achieve the required reach will instil your punches with greater and more balanced power.
When sparring, contact is (or should be) substantially lighter than in a real fight. As a consequence, when sparring, boxers tend to execute punches that barely reach their opponent; that merely tap them. The downside to this is that, during a fight, you want to punch through you target, which requires a different estimation of range. You generally fight as you train, so if when sparring your punches always end the instant leather touches flesh, you risk throwing ineffective punches during a bout. To help prevent this, you can practice punching through the target when doing pad work and bag work, and practice pulling your punches in sparring; by getting slightly closer to your opponent so that you always have an extra fist's distance in reserve. This habit will also help reduce your miss count, as you will have created additional margin for error.
Mayweather routinely showed fullish rotation when he employed his pull counter. It's an awesome technique to have in your arsenal, but it takes excellent torso flexibility and strength, and immaculate timing. You also run the risk of being countered by a left (and right) hook, and even Mayweather's defence falls short in this regard (see 2:00).