Yes, there is an entrance fee. As of 2023, the entrance fee for Torres del Paine for foreigners is 40,000 pesos for 3+ days. It's cheaper if you're only visiting for a day or two, but if you're hiking, I'm assuming you'll be more than 3 days.