It is not entirely correct to consider the "energy of an electron" in this regard. The energy is not associated with the electron alone.
Rather, we call it electric potential energy and it depends on total electric charge at the same spot and is compared with some other area in the circuit where the potential energy is zero as a reference. Because, if there is a lot of e.i. negative charge at one point and a lot of positive charge at another point, then electrons will be repelled from the negative area and attracted towards the positive area. This gives electrons a tendency to move towards the positively charge area in a circuit, and such tendency is described by a difference in (electric) potential energy.
Just like a book on a shelf has a tendency to fall down to a lower spot, if it gets the chance, because of the difference in (gravitational) potential energy.
More charge gathered at a point increases the repulsion of further charges (of the same sign), so the "will" for new electrons to move away from this point is larger. Therefore this point has larger (electric) potential energy than if less charge was gathered here. We say in short, that the (electric) potential in one spot is larger than the (electric) potential in another spot.
To move the capacitor plates closer together increases the attraction between the charge on each plate (there is negative charge on one plate and positive on the other and the closer they are, the more they attract each other - simply explained by Coulomb's law about electric forces). This will therefore cause more charge to build up, and therefore give more charge to add to the total repelling force, which thus in turn corresponds to larger potential energy. Also, larger area of the capacitor plates allows more charge to build up.
That is why the physical dimensions and construction of the capacitor affects the potential energy that is possible to store.