When to enhance a dataset of images with flips and rotations of the images?
Those operations should  be performed on the training data part. We are introducing varieties into the training data set. 

If you were to do the rotation and flipping data and then you split the data set with the possibility of the rotated image of the test data being included in the training procedure. You are giving the model a glimpse of the target that you are going to test later, which defeat the purpose of testing it on new unseen data. 

The cross validation and test data should be examples of real life data that your model works on. Suppose your test data are flipped in the real life regularly (for example, a car facing different way), then perhaps it can be justified but those flipped images of the test data shouldn't be included in the training procedure.