The general rule is that the cleanest and strongest recording is the best. You want the signal (bird song) to stand out above any noise, and also to be isolated from other bird sounds or other noises.
That said, modern phones and Song Sleuth together do a good job of picking out faint sounds, and the app is capable of identifying moderately distant sounds. Overlapping bird sounds in a chorus are definitely a challenge, but for some species that are often found in noisy flocks, e.g. Canada Goose, Common Grackle, etc, the app has been trained to recognize the flock chorus. In all cases trimming and filtering will help to isolate one sound and allow the app to work.