Mac Dictionary defines it as:
mend (knitted material or a hole in this) by weaving yarn across the hole with a needle : I don’t expect you to darn my socks.
• embroider (material) with a large running stitch.
a place in a garment that has been mended in such a way.
ORIGIN early 17th cent.: perhaps from dialect dern [to hide,] which is from Old English diernan; compare with Middle Dutch dernen ‘stop holes in (a dike).’
darn 2 (also durn)
verb, adjective & exclamation informal
euphemism for damn : : [as v. ] darn it all, Poppa | [as adj. ] the darn things were expensive.