Toothpaste is good from 12 to 18 months which means it's effective at cleaning teeth and getting rid of bacteria for those 12 to 18 months.
After 12 to 18 months the toothpaste is still safe to use however it may not get rid of bacteria in your mouth or prevent gum disease tooth decay etc.
If your toothpaste is over 18 months old then you're likely not brushing your teeth enough. :)
I go through more than a tube a toothpaste in a year since I brush my teeth 3 times per day to keep them healthy so the 12 to 18 months for toothpaste doesn't bother me.