The answer to that question depends on how long you anticipate keeping the same loan, and how much interest you will save by paying the discount points.
At a very simple level, here is how you estimate the answer to the question.
Suppose you want to borrow $100,000 on a 30-year fixed-rate mortgage. You think you can get a 7% interest rate with no discount points, or you can save 0.25% if you pay one point. The one discount point will cost you $1,000.
At a savings of $16.70 per month, it will take you 59.88 months, or almost five years, to save enough money to reimburse yourself for the $1,000 paid in points.
Will you own the property that long without refinancing? Probably not. If you do not keep that loan in place for five years, you will have lost money by paying the discount points.