Ok mate here is a piece of advice for you from someone who has only played caro - kaan against 1.e4. Straight forward answer always take the knight with bishop till the time you start noticing that bishops are important for you in your endgames. I am 1000 rated rn and I have always taken knights coz till 1200 it doesn't matter, because people can't capitalize even with having 2 bishops. You will observe people's till 1200 doing very common blunders which you can take advantage of easily. Now the thing is "generally" bishops are considered better for endgames coz of the free space on the board, so coming back to your question, I guess you will be able to decide when to take the knight when you have reached 1500-1600 minimum or maybe above that range. But dont trade a bishop for a knight in a open endgame.
What to do when opponent responds to Bg4 pin with h3 in Caro-Kann?

Ok mate here is a piece of advice for you from someone who has only played caro - kaan against 1.e4. Straight forward answer always take the knight with bishop till the time you start noticing that bishops are important for you in your endgames. I am 1000 rated rn and I have always taken knights coz till 1200 it doesn't matter, because people can't capitalize even with having 2 bishops. You will observe people's till 1200 doing very common blunders which you can take advantage of easily. Now the thing is "generally" bishops are considered better for endgames coz of the free space on the board, so coming back to your question, I guess you will be able to decide when to take the knight when you have reached 1500-1600 minimum or maybe above that range. But dont trade a bishop for a knight in a open endgame.
Thank you for your advice! Generally I like taking the knight if no other pieces are defending it other than pawns to force my opponent to double pawns in front of their king. However I also have not noticed any increase in end-game performance if I don't trade the bishop. I will consider trading every time going forward until start to notice a difference like you suggested. I appreciate it!

As a general rule, don’t trade bishops for knights without good reason.

As a general rule, don’t trade bishops for knights without good reason.
Thanks for your comment. I am glad I asked because I am seeing conflicting advice on whether or not to take the pin. I do agree that it creates weaknesses in my opponent's pawns, but also at my level I am not too confident in my ability to take advantage of those weaknesses. Oftentimes I am more annoyed dealing with the advanced pawns than I am focused on the holes.

but like other than this line
you are not going to get Bg4 often
I am learning CK mainly through IM Alex Banzea's YouTube videos. How he taught it was to play Bg4 almost every chance I get if my opponent played Nf3, and to only go Bf5 if Bg4 isn't available. So I am seeing Bg4 almost every game. How I currently respond to the 2Knights variation you presented is by playing 3.__ dxe4 and going for a Tartakower transposition.
1.e4 c6 2.Nc3 d5 3.Nf3 dxe4 4.Nxe4 Nf6 5.Nxf6+ exf6

its an improved tartakower in a sense because the main line white does not put a knight on f3 but on e2

My question is how should I know if it is better to take the pinned knight w/ Bxf3 rather than retreat the bishop? Is there a general rule to follow?
You can retreat the bishop to h5, to maintain the pin a bit longer.
Or you can exchange on f3 and then play ...e6, putting your central pawns on light squares (to "replace" the light-square control that your now-missing bishop has given up).
Both are playable and it's fine either way. They just lead to different lines, is all.

I am studying Gotham Chess Caro Kann and he recommends a little different vs two knights variation Tarkakower Transposition.
You can't force it if it's not there remember, so you have to respond with what white plays.
Gotham's CK course puts emphasis on castling Kingside first and trying to get rook to A file.
There are more variations in his course and analysis, but Gotham is not always an advocate of Bf4. The Tartakower is a tricky variation, with a lot of ways to attack, but you can just as easily mess it up badly. So Gotham gives suggestions for playing it more solid vs. playing it more aggressively.
I like Gotham too so I will look into his CK videos as well, thanks! I like Tartakower because once I get into those lines, most of my pieces move to very intuitive and natural squares. I agree that it is more important to get castled and keep king safety first. Alex Banzea also put emphasis on these priorities: "First we castle, then we pin." I like the advice on putting my pawns on the light squares to cover for the fact my light square bishop would be missing. I will be trying this out going forward.

Just do the classical variation
What about in exchange, advance, or fantasy variation games? I play Bg4 pin in almost all main variations for CK, so I would still like a general rule to try to follow against the h3 move. Playing 4.Nc3 Bf5 only helps answer my issue in the classical variation.

I'm an amateur player learning the Caro-Kann. I noticed I frequently get into positions where I'm pinning my opponent's knight on f3 with Bg4. Oftentimes my opponent will respond with the pawn move h3, assumingly wanting to follow up with pawn g4 if I retreat my bishop with Bh5. I see this type of pin in other openings too (as both colors), just more often when I play CK.
My question is how should I know if it is better to take the pinned knight w/ Bxf3 rather than retreat the bishop? Is there a general rule to follow?
Thanks in advance!