There really isnt a way to know unless you know exactly what worms he had
Parasites and worms grow at different stages and most dewormers are only effective at killing the adult stage worms, so you need to readminister the dewormer at certain points to kill the juvenile worms as they become adults
Another fecal check and/or (if tapes) you never see tapeworms again.
Most vets will recommend a deworming schedule for indoor and cats that go outside. iirc, indoor can be done once or twice a year - less if you're preventing fleas and other possible modes of infestation. Cats that go out need to be done every 3-4 months because they can pick up round and tapeworms easily.
I just want to add that you should never use over-the-counter dewormers. Until you know specifically what type of worm your cat has (or even if it does have worms), you are giving them unnecessary poison. Taking a fecal sample to your vet iand having them prescribe the correct dewormer is the safest route.