The 'scale length' of your guitar and bass refers, broadly speaking, to the 'sounding length' of the instrument's strings—that is the length between the nut and the saddle.
I say 'broadly' as, if you measure this, you'll find each string's measurement to be a little longer than the actual scale length. This increased length helps the instrument to sound in tune all over the fingerboard—it's called compensation or intonation and we'll get into that another day.
To accurately assess the scale length of an instrument, you need to measure from the inside of the nut to the centre of the 12th fret. Once you have this, double it. That's the scale length.
So, if you measure your Strat, you'll find a nut-to-12th-fret measurement of 12.75". Doubling this gives us 25.5". That's our scale length. Easy peasy.
So why do we care?
Scale length actually makes a big difference. It affects the feel, playability and even the tone of an instrument.
Longer scale, bigger gaps
Lets get the obvious stuff out of the way. A longer scale length means the gaps between the frets will be correspondingly wider. At a very basic level, if you've small hands, you might feel more comfortable with a shorter scale instrument.
The longer the scale, the more tension must be applied to the string to achieve the same pitch. So, the same gauge strings will feel 'tighter' on an instrument with a longer scale.
This is one reason a lot of people prefer a Les Paul over, say a Strat, when it comes to big bends—the Gibson's slightly shorter scale makes for easier bends.
This scale length affect on tension can be helpful to consider with bass guitar too. Especially so for a 5-string bass. That bottom string wants to flop about and can lose focus easily. If you can't seem to get it tamed, maybe shifting to a longer scale (perhaps from 34" to 35") will do the trick.
The part played by string gauge
We can't go on without considering string gauge. Because shifting up a gauge of strings also increases their tension, perhaps a heavier bottom on that 5-string will work without the hassle of buying a new bass.
String gauge should also be considered when you're going to a shorter scale instrument. I'll often talk to someone who's bought a Fender Jaguar and has strung it up with the same set of 9s they use on their Strat. The result can often be a bundle of floppy, weedy, instability. As the scale length shortened, the string tension reduced. Ligher strings need less tension naturally so… floppy strings.
If that's your thing, go for it but I'd recommend a heavier string than you're used to if you move to a Jag. Remember that the heavier string tension will be somewhat cancelled out by the reduced scale length tension. On the shorter scale instrument, you'll feel comfortable playing a heavier string than you might think.
The big one: TONE
Scale length plays a HUGE part in your instrument's tone.
Where all of the overtones and harmonics sit on a string is determined by its scale length. With a longer scale, and more room for the harmonics to breath, you end up with a more clear, ringing tone. Think of the shimmer of a Strat here. That increase in tension brings more focus too.
Conversely, as the scale shortens, things become a little more crowded together. Tone thickens up and we hear that as more warmth. Think of our Les Paul tone here. We loose a little of the tightness in the bass as we gain that warmth, though.
As an example, my own Blue Collar model has a 25.5" scale length and is fitted with a P90-style pickup (one you'd associate more with a Gibson). While the Blue Collar can certainly growl with the best of them, it keeps more focus and tightness because of its longer scale. That P90 brings a broader sound than, say a Tele or a Strat, but it never strays to muddiness. I love it (but, then I'm biased).
And, of course, the same goes for basses. A 30" scale will usually give a warmer, darker tone than the more focussed, clearer tone of a 34" bass.
So what's the best scale length?
How long's a piece of guitar string? Ha! Really, though, it's horses for courses—depends what you like and what you're aiming to achieve.
Keep in mind the fundamentals of tone and feel and then try a few different instruments to see what feels and sounds right to you. Remember to keep string gauge in mind as you go, though. A different gauge can change the sound and playability of any instrument you try (including the one you play all the time). ;-)