You obtain the whistle after completing the level "Leap Hole" in Chapter 2. Once you have it, you can use it any level (including earlier levels if you go back to them).

To use the whistle simply hold down the left mouse button anywhere except on top of a ball. Nearby unattached Goo Balls on structures will begin to move faster, and will adjust their movement to generally move closer to where you're whistling.