Selling Rental of 15 years and impact depreciation has on capital gains.

I am considering selling my rental of 15 years but don't quite understand what the impact depreciation will have on my taxes. With that said I learned that you are required to depreciate expenses if they exceed a certain dollar amount, yet was under the impression depreciation can come back to haunt you if you sell the property. I am naïve on this subject as my intention was to keep this property indefinitely...but times change. Thanks for any insight.