Ideally you want to prune when the tree is dormant, but as long as it’s not in the process of leafing out, you won’t hurt the tree. I say that because the tree is expending a lot of energy in the leaf out process and makes it more susceptable to pests and disease. As far as pruning goes, you want to open up the middle of the tree and encourage lateral growth to allow for sunlight penetration and the reason is twofold. A)to ward off apple scab, a fungal disease which thrives in moist conditions and B)shaded branches have a tendancy to not bare decent fruit.