Why did I get only 5 points even though I won? I'm learning chess and I practice in the chess.com app. I don't understand how the winning points are calculated in every match.
Most chess sites use some variant of the Elo rating system

If you have a much higher rating than your opponent, the expectation is that you will win. So if you do win, then we haven't gained that much information, so the change in rating for both you and your opponent will be small. If your opponent wins, there will be a much larger change in rating as their win was less expected.

In your case, you have a rating of 775 and your opponent had a rating of 651. Since you have a much higher rating, winning didn't result in a large rating increase. If you had won against someone much higher rated than you, you would have experienced a much larger rating increase.

Mathematically, the rating change of each player is calculated as some empirical constant (K, 32 is often used) multiplied by the difference between the actual score and the expected score of that player against the other. The expected score is calculated from the difference of the two ratings.