Most livebearers live for around three years if they are looked after properly, the fish can reproduce until the day it dies. Also the female doesn't even need a male around to give birth, as it can store sperm from the male and give birth for several months.
Only way to not have babies is to either keep males (mollies are renounde for fighting though)
Or keep poor quality fish.
As with healthy fish their primary goal is to breed!
take out your males. after a few months the females will have no sperm left and will stop having babies. other than that, get rid of the females and just keep males but be aware they may fight.