What limits length of wire connecting audio amplifier to speaker?
The primary limiting factor will be the series resistance of the wire. 

Let us work with a speaker of 8 ohms. 

If the connecting wire were 18 AWG it has a resistance of 0.021 ohms per meter. If you were to connect the speaker with 50 meters distance from the LM386 (for a total wire path of 100 meters) the wire resistance would be (0.021 * 100) = 2.1 ohms. In such instance over 20% of the signal energy from the amplifier would be spent in the cable as heat and the rest going to the 8 ohm speaker. 

(2.1 / (2.1 + 8) = 20.7%

You can use this example to evaluate other wire sizes and understand the effects.

Note: For audio frequencies do not fall victim to the marketing efforts of companies like Monster Cables that would have you believe that you need 8 AWG copper cable with gold plated connectors to connect up an 8 ohm speaker. Conventional low cost 16AWG lamp cord is almost always more than adequate to connect speakers at a reasonable working / listening distance.