There is really no science to it. The more you add, the less often you will need to dump it out and replace the pickling lime. If you only add a few tablespoons, then it will only last a limited amount of time.
That being said, you should avoid adding the sediment that settles out into the tank.
The next natural question is when has the pickling lime served its purpose, with most of the calcium and alk extracted and all that is left is sediment and filler? It is hard to tell, but I change mine when the white powder becomes more of a grey color. It still has an elevated pH, but seems to be "used up" at that point.
I do not test the liquid for calcium or alkalinity, but that would be a way to do it also.
Mat