I think I'd used it for five weeks when I stopped using it. My GP said it was fine to stop as I wasn't in pain anymore. My personal opinion is that stool consistency is what's most important to avoid problems in the longer term as that's how I stayed fine for years. Never, ever push during BMs and make sure the BMs are soft and formed.
Ask your GP for advice as they will be able to give a personalised recommendation for your individual case. Are you still experiencing pain after BMs?