How long are written check stop payments valid?

It depends on the bank. Most stop payments are lifted after 6 months. Here's an article about how to stop payment on a check.

http://stopchex.com/how-to-stop-payment-on-a-check.html