How to determine the number of forward and backward passes in deep learning (CNN)?
Forward and backward passes of the whole dataset are called epochs. The number of epochs is a parameter of the training procedure that cannot be estimated a priori, and it depends on how low you want your training/validation errors. One approach is to train until your validation error is small enough, and as long as the number of epochs is smaller than a threshold. Another approach is early stopping: when the validation error achieves a minimum, stop training. For a broader explanation on early stopping, see this blog.

To sum up: the number of epochs is particular of every network and dataset, as well as optimization technique, and you should set them in order to have a low enough loss, but not overfit (early stopping is done in order to not overfit).