Kidney stones (aka renal calculi) are made up of tiny crystals and usually sit in the kidney or the ureter or the bladder.
A common myth is that eating tomatoes causes kidney stones. If this were true, everyone who eats tomatoes in this world should have had stones in their kidneys!
Kidney stones are normally caused when urine becomes concentrated and certain substances combine to form a crystal which is too large to pass thru urine. So, the biggest risk factor for kidney stone formation is dehydration. The most common form of kidney stone is calcium oxalate stone.
If you are diagnosed with this problem, it's best to get your doctor's help in treatment. And yes, you need to avoid certain foods including tomatoes till you are completely cured of it. Thereafter, prevention entails drinking plenty of fluids / water, and eating a healthy diet.
There's no need to avoid tomatoes if you do not have kidney stones.