The length of the shaft is generally set by the club in question. Indeed, each specific club is associated with a specific shaft length. For example, the driver will feature a much longer shaft than will the sand wedge.
While that may be true, a golfer can still adjust the length of a club by the way he places his hands on the grip. Indeed, a golfer can choose to place his hands at the top of the club or he can choose to do so at the bottom end, where the shaft is bare and uncovered by the grip (or anywhere in between for that matter).
Firstly, the length of the shaft determines quite directly how far away a golfer is from the ball. And as a rule of thumb, the furthest away a golfer is the more energy will be generated by the club. So if you were to grip the club lower than you normally would, you would end up with a club that generates less speed and one that should send the ball a shorter distance than it normally would.
Secondly, gripping the club lower will allow the golfer to exert greater control over a shot since he will be closer to the ball than he would otherwise. This can prove helpful for delicate shots that don’t require the maximum distance that a club can provide. Chip shots from around the green are prime examples of this.
Thirdly, a shaft becomes stiffer the shorter it is. As a consequence, a shorter and therefore a stiffer shaft won’t feature as strong a whipping motion as a full length one and will send the ball on a lower flight path as a result.
Finally, a golfer may choose to grip down on the club in instances where the club must not penetrate the ground but should rather hit the ball thinly. As an example, shots from fairway bunkers can’t be allowed to dig into the sand and instead must be hit relatively thinly in order to get the maximum distance from them.