to obe honest the answer to this question is varied depending upon which stage of testing you are within. Ultimately Testing is a subset of QA - and the QA standards will state what criteria satisfy a testing stage to be deemed to be completed. These standards could be known as 'exit criteria' and when these criteria are met then the test cycle can be deemed to be complete. (Test strategies / plans and specs will ellaborate these areas)
This kind of question is used as a trick question. The person asking may be looking for Testing is never done .
Usually the QA team is squeezed for time so you are forced to do the best given the time you have. So while you finish testing because the due date was reached the best answer is to say that Testing is never done .
The easiest way to decide when to stop testing is to create a Defect Metrics. Its a graph which is plotted on x - y axis....x being Build Nos. and y being No. of defects found.You plot the no. of defects found in each build in this graph and seeing the trend u can evalute when the plot comes down n becomes a stagnent one...
1.In real testing never ends because no software can be error free. But so as to get satisfaction to testers we can say that when all the test cases written by testers completes and all of them get fixed and retested we can say testing is over.
2.When release date of software comes then managers forced testers to complete testing that time it forcefully completes.