Is there a maximum length for an unbalanced audio cable after which you should use balanced?
The answer is: it depends. It depends on how much RF noise is in the environment you're running the cable through and it depends on how strong the signal is you're sending along that cable relative to the noise in the environment.
It's not typical that you've got a choice of outputs on a device between balanced and unbalanced but, given a choice, I'll always take balanced no matter what the length of the run.
It depends on a lot of things!
1) What else is going on? How many other cables are in the vicinity of your cable? The more other cables you have in the area, the more likely there is to be interference.
2) How thick and well-shielded is the cable? A consumer, high-gauge, thin little bit of zip wire is much more susceptible to interference than thick, heavy, well-shielded cable.
3) How much RF noise is in the environment? You probably have to test this to find out!
4) What levels are you transmitting? Very low levels (Mic, Phono) are much more susceptible to interference than line levels. High levels (speaker cable) are rarely balanced.
4) That said, you would be nuts to try to run unbalanced for more than 25 feet, or 50 at the most.
In practice, experienced audio engineers will always use balanced cables when they have a choice, but for many situations (e.g. a simple setup for recording a podcast with one mic, a mixer, a digital recorder, 2-3 foot runs, and heavy duty cables) unbalanced cables will probably be fine.
You can go as long as it doesn't start interfering with your sound.
The truth of the matter is that guitar rigs with a lot of pedals in them will eventually end up with a lot of cable-feet.
Especially if you're using a 20'+ cable in or out, unless you have your pedals arranged in series and connected with a bunch of 6" patch cables, you're going to end up with easily over 40 feet of cable.
I use a 20' cable going in or out, depending on the room and if I'm recording or not, and a 10' cable going out, or in. But I don't arrange my pedals in series, I arrange them for convenience sake of playing. I probably have about 2' in 6" patch cables and at least another 4-5' in arrangement patch cables. So on any given session I'm running my signal through a total of just under 40' of unbalanced cable. I get no RF interference what-so-ever. I'm also using a compressor as a clean boost, which can be notorious for amplifying RF signals, I've never heard anything where I live.
However, where I used to live, with far less cable, my compressor would pick up the 105.1 radio station locally, but very faint, and it was pretty much specific to where the pedal was in the room. It was also the pedal, as I said, there was far less cabling back then.
If you're trying to run your signal over huge distances, say you have your pedals in front of you in the control or tracking room, but your amp (the studio doesn't have a wall input system in this scenario) is far away. You'd be better off to run out of your pedals into a DI, on a balanced line, to the where the amp is. Then take that balanced XLR signal through a reamp box, bringing back to unbalanced and an appropriate line level.
In the end, the main thing you want to watch out for is having a bunch of excess cable that you find yourself coiling up next to you so it's not getting tangled everywhere. At that point you're amplifying the cable's conductance (Guitar pickups are inductors, cables are capacitors) by coiling it. This will increase the amplification of any RF interference entering the signal.