See the ITTF ranking document here. The short answer is that you get a number of points for a win in an ITTF sanctioned event (an official tournament), and depending on the kind of event it awards more or less points. Page 8 shows the points; winning the Olympics gives you 2000 points, placing top 64 gives you 45 points. Winning an International Event gives you 75 points.
You take your top 8 finishes by points, and then everyone does the same, and sort by points - whomever has the most points in their top 8 events is #1, whomever is second most is #2, etc. These ranking points last for a year, so if you win an Olympic event in 2024, you will have 2000 points (plus your next 7 finishes!) for the next year, but in summer of 2025 it will expire and those points will go away (and be replaced by your next highest finish).
A player might have:
- Olympic win 7/28/2024 = 2000
- Continental Cup win 8/19/2024 = 500
- WTT Contender finalist 9/15/2024 = 280
- International Event win 8/12/2024 = 75
- International Event win 9/24/2024 = 75
- International Event finalist 7/15/2024 = 55
- International Event finalist 9/8/2024 = 55
- Continental Championship R16 11/4/2024 = 45
- Continental Championship R16 2/4/2025 = 45
- WTT Champions R32 5/16/2025 = 15
On 6/1/2025, their ranking score would be 2000+500+280+75+75+55+55+45 = 3085 points (leaving off the last two since they only keep the top 8 scores). On 8/1/2025, two events would fall of - the Olympics and the International Event finalist from 7/15 - so they'd have 500+280+75+75+55+45+45+15, or 1090 points, if they didn't have any additional results that scored in that time period.