I'm just about to google it but my understanding has always been "do it now, before it gets worse"
A stitch on a small tear will prevent it becoming a large tear and needing more.
I'm expecting that to be complete buncombe, but it makes sense to me.
post-google edit: this would suggest I'm correct http://www.phrases.org.uk/meanings/a-stitch-in-time.html
Yep
Never would have figured it out though