You should keep training sessions short (up to 15 minutes for many dogs) and stop if your dog is showing signs that they are not able to concentrate.
Keep cool! If your dog is struggling with a task, go back a few steps in the training process and build back up again.