Opportunity Attacks occur before the target leaves your reach.
The rules for opportunity attacks state:
The attack occurs right before the creature leaves your reach.
And Sentinel states:
When you hit a creature with an opportunity attack, the creature's speed becomes 0 for the rest of the turn.
Since it happens before they leave your reach, their speed becomes 0 while they are still within your reach.
Now, if you are playing on a grid, the rules break your movement down into five foot chunks:
Speed. Rather than moving foot by foot, move square by square on the grid. This means you use your speed in 5-foot segments. This is particularly easy if you translate your speed into squares by dividing the speed by 5. For example, a speed of 30 feet translates into a speed of 6 squares.
Using this rule, the target would simply remain in the square they are in. However, if you are measuring movement foot-by-foot, then the target would be stopped when they are exactly five feet from you, but I've never played at a table that used that level of granularity for movement. I've always played that sentinel just prevents the target from moving entirely, as it would be on a grid, even when not playing on a grid. It's simpler that way.