Stone shape can affect an amount of stone up to 10 cubic feet + 1 cubic foot per level. If the shape you want to effect is narrow enough, you could get a lot of distance while staying under this volume. For example, a 10th level caster has a maximum of 20 cu. ft. Could such a caster touch the side of a mountain and bore an 1,600-foot-long hole through it if the hole was only 1.5 inches in diameter? The volume of this hole would be π(0.0625²)(1600) = ~19 cu. ft.³. What about reshaping a 2.7-foot cube of stone into a cylinder of similar dimensions?
Theoretically, pretty far, but you cannot drill through a mountain
By my reading of the rules, the spell allows you to "form an existing piece of stone into any shape that suits your purpose," (emphasis added), but the "stone or stone object touched" is limited in size by level. So you need a discreet and unitary piece of stone to work with; RAW do not explicitly allow you to change a part of a larger piece of stone. A mountain far exceeds even the 30-cubic-foot size that a 20th level caster can shape, therefore tunneling through a mountain with this spell (or in any way affecting the shape of the mountain) is impossible.
Another reading of the rule is that you can in fact alter the shape of stone that is part of a larger volume of stone beyond your power. This is a flawed interpretation in my opinion because the rulebook's spell description specifies you can change a "piece of stone" and the Oxford Dictionary defines the word "piece" as "A portion of an object or of material, produced by cutting, tearing, or breaking the whole"--i.e., a discreet object separate from a larger whole.
However, if you do accept the second interpretation, then you can tunnel in the method described. You would have to shape the stone into a very thin tube and expand the excess volume out of either/both end of the tunnel so that you did not affect any more than the allowed volume.
A 10th level caster could create a 1,600 foot long x 1.5 inch diameter pole out of a 19 cubic foot boulder, though whether you could control the direction(s) it extended would be up to the DM. You could also shape an extremely long and thin piece of stone (like a banister maybe) to your own purposes.