The short answer is that it is impossible to KNOW when the best time is to sell a stock.
There are a number of reasons to sell a stock:
You need the money
Company fundamentals have changed
Share price has advanced very rapidly, perhaps unsustainably
The stock is overvalued
The stock is overvalued compared to its peers
The dividend has been cut