i typically keep mine for 2 or 3 months, but it'll depend on how many times i brew. if i've been using a batch for a while, i might re-dose it with a little more star san to ensure i'm back under the required pH. i should get some test strips... but i haven't.
when i'm ready to replace my batch, instead of dumping all of it i save a gallon or two in an empty milk jug. i then use that less-than-fresh star san in my blowoff tube setup.