when mixed with distilled water it lasts almost indefinately. if mixed with tap water, the minerals in it will react with the starsan and make it less effective over time. how long depends on your water. i normally make a 5gal keg full of it once a month with filtered (but not distilled) water, and it lasts fine.
you can use pH test strips to determine if it is good- as long as the pH is lower than 3, its good to use.