The Sun maintains its size and shape against the outward pressure of fusion energy by the force of gravity. In other words, its own weight keeps the Sun from growing larger. It is the stable balance of outward gas pressure vs. the inward pull of gravity that determines the size of any star.