I'm sure there was a US sub who tried to rig a sail after being badly damaged in a depth charging, but they were unable to get anything to work and abandonned the vessel. Unfortunately I can't find the info, so I may just be imagining it.
Here's a newspaper report of a British sub that stopped answering its rudder, lost one screw and ended up beam on in rolling waves and had to call for a tow. They tried to rig a sail to bring the head round to sea, but it failed.
http://trove.nla.gov.au/ndp/del/article/91414717
That's dated March 14, 1944, but not sure when the actual event happened. Info is a bit sketchy.