In order to be able to decide when an activity from the Sprint Backlog is completed, the Definition of Done (DoD) is used. It is a comprehensive checklist of necessary activities that ensure that only truly done features are delivered, not only in terms of functionality but in terms of quality as well. The DoD may vary from one Scrum Team to another, but must be consistent within one team.
There might be different DoD at various levels:
DoD for a Scrum Product Backlog item (e.g. writing code, tests and all necessary documentation)
DoD for a sprint (e.g. install demo system for review)