Are both grammatically correct? Yes.
Do both communicate the same idea? Yes.
Are the contexts for which each of these would be said the same? I don't think so.
I can't put my finger on it, but I think it's the word "appreciate" that's making me think you'd use these sentences in different scenarios. Usually when we say the word appreciate, we are expressing gratitude. Thus, I tend to lean toward the, "I appreciate your sentiments," version of the sentence. Saying, "the sentiments," seems a bit impersonal if you are expression appreciation for someone. I could see it being said between two people, but using "your," is more personal, and thus, I think would be used more often.
So when would, "I appreciate the sentiment," be used? Well, I could see this being used sarcastically between two friends--either as a joke or in response to something that was said with good intentions by one friend but wasn't received well by the other.
AS A JOKE
Friend 1: Check out this new jacket, isn't it cool?
Friend 2: It looks like it came from my dad's wardrobe. (Friend 2 is not a fan of the jacket)
Friend 1: *rolls eyes* I appreciate the sentiment. (Friend 1 is not appreciative of Friend 2's opinion)
MEANT TO BE HELPFUL BUT WASN'T RECEIVED WELL BY FRIEND B
Friend A: Hi Friend B, why do you look sad?
Friend B: I'm sad because I just failed my exam. I scored a 65.
Friend A: Well, there will be another exam. Don't worry about it. (Friend A shows little to no concern)
Friend B: I appreciate the sentiment. (Friend B doesn't appreciate the opinion because they are more studious than Friend A).
I could also see the second sentence being used between two people commenting on the words of a third person. After hearing a speech, you could lean over to the person next to you and say, "I appreciate the sentiment." If it was a good speech, it is likely that the other person would nod their head in agreement. You could also substitute "the" with "his/her."