I've been told that you should never ask for a tow when you are stranded at sea. The reason given is that the person towing can claim a huge share of the stranded boat, potentially all of it if it's abandoned. Is this really codified somewhere? Should I avoid asking for a tow if I'm stranded because of this?
If you run out of fuel, have engine trouble, run aground soft, when there is no immediate danger to the marine environment, the boat, or the persons on board, then towing is just towing.
If a vessel is hard aground, stranded, on fire, or sinking, and is towed from the site, it may be considered a salvage operation. This once meant a reward of a portion of the vessel's cargo, but now it just means the rescuer is entitled to reasonable fees determined in a standard way (see the link below).
This is international maritime law, and applies to the open seas (outside the line of demarcation, in the U.S.).