There is so solution for this question:
1. Deadlines of the projects reaches.
2. Test cases completed with certain percentage passed
3.Stop When Scheduled Time For Testing Expires
4.Stop When All The Test Cases Execute Without Detecting Errors
testing can be done till the product has a no bugs..
This is difficult to determine. Many modern software applications are so
complex, and run in such an interdependent environment, that complete testing
can never be done.
Common factors in deciding when to stop are:
• Deadlines (release deadlines, testing deadlines, etc.)
• Test cases completed with certain percentage passed
• Test budget depleted
• Coverage of code/functionality/requirements reaches a specified point
• Bug rate falls below a certain level
• Beta or alpha testing period ends