About 300 years of rock phosphate left at current rates of comsumption. We need to start farming phophates in the sea, where all our water soluble nutrients eventually end up.
But this isn't quite the big deal that it's made out to be. Mineral phosphorous mining is cheaper than other sources, but phosphate isn't rare or going away. It's literally present in all biomass by definition: phosphate groups are the bonds that tie the links together in RNA and DNA, and it can be extracted from biomass trivially (i.e. composting, or even incineration), albeit at somewhat higher cost. Given that agricultural output is currently almost free, that's hardly going to break society.