After putting slime into a tire to seal a leaky tire the slime will last for up to 2 years in the tire before it starts to dry out and then the leak may start again.
Usually by the time the slime goes bad in the tire it's usually time to replace the tire anyway.
I've had slime in a car tire for 3 years before it started leaking again but it's rare for slime to last that long and by then the tire was ready to be fully replaced anyway.
Slime though should only be used if you don't have a spare tire or cannot safely put on a spare tire and can really only be used to fix slow leaks.
If you have a spare tire then put the spare tire on and take tire with the leak to get repaired which is usually around $10.00 to $15.00
The tire will last longer with a proper patch.