"Is there a theoretical limit to how big can a star get, or would it collapse from gravity before? If no, then in theory could we get a star as big as a mini-galaxy?" Asked By: Théo De Freitas Neto
The main determining factor in all of this is the mass of the star. The mass of the star eventually determines the potential size of a star. So I'll start off by mentioning how the mass effects the star, and then explain why you’re not going to get a radius the size of a mini-galaxy.
First, at the beginning of star formation, you have a molecular cloud that may be 200 thousand solar masses, such as the Orion Molecular Cloud, for example. We can use Jeans Mass and Jeans Length (I’ll explain it a bit later on), to work out the size that a part of a cloud needs to be in order to start to collapse and start star formation. This is dependent on the mass, density, and the temperature of the molecular cloud. When it starts collapsing, you're going to end up with parts of the cloud that are denser than other parts, so you get what is called "Fragmentation."
Basically, the original Jeans Mass determines the size the initial cloud needs to be in order to collapse. As it's collapsing, the Jeans Mass decreases more and more due to pockets of greater density. Thus, instead of a 500 solar mass star from a 500 solar mass cloud, you're more likely to end up with 100 smaller stars.
Let's say, for example, that one of the stars that forms is 80 solar masses. That's 80 times the mass of our sun, so it's pretty huge. It is going to end its life with a supernova, leaving behind a black hole. Of all the main sequence burning cycles in stars, the cycle where hydrogen is burning requires the lowest temperature, it only needs about 4 million degrees. Compare this to the 15 million needed for the CNO cycle (which is still the burning of hydrogen but using Carbon Nitrogen and Oxygen as catalysts). Moreover, helium burning kicks off at about 100 million degrees, carbon burning at 600 million degrees, oxygen burning at about a billion degrees, and silicon burning at 3 billion degrees.
So as you can see, a 80 solar mass star is going to need to be AT LEAST 3 billion degrees in temperature at its core before it can even start burning Silicon to form Iron. Really then, the hotter that the core is, the more energy that is being released--And that energy has to go somewhere.
Ultimately, virtually all stars are in a state of hydrostatic equilibrium (variable stars are the exception). This means that the outwards radioactive pressure and the inwards force of gravity are at equilibrium.
Now this is where the absolute radius comes in. At some point, gravity is going to be equal to the radiation pressure at the extremity of the star. Taking our star for instance, at ~700,000 km from the core, our Sun's outwards pressure is equal to gravity; hence, this is what we would constitute as its surface. In larger stars, it does become a little more complicated because the star is producing FAR more energy. As such, there is a very strong solar wind that tends to blow some of the star away (but the basic principles still apply).
As for actually calculating how big a star can get in radius, there is no equation to do that and it is VERY difficult to even get moderately accurate computer models. The composition of the star plays a huge roll in how large it can get, the more metals that are in the star to begin with make the star less opaque to the emitted radiation which means that the star is going to be a little more puffed up than if it had less metals (radiation pressure becomes more effective). It also depends on how the star has evolved over time, how much of its mass it has actually lost due to its immense solar winds, whether or not it passed through an "instability strip" earlier on and became unstable for a time.
So basically, the mass is more or less the determining factor as to how large in radius a star can become, but it will never get to the size of a mini galaxy because, eventually, radiation pressure from the star will lose against gravity and gravity will hold it back. Even if that doesn't happen, the star will just keep puffing away its outer shell, and that gas will just eventually mix in with the Interstellar Medium, where it is no longer even constituted as being a part of the star.
As a side note, as in the very early universe, at the time of the first stars, there were no metals. It was just hydrogen and helium ;with traces of lithium which were consumed prior to the main sequence anyway so the stars although having a very large mass also for their mass were far smaller than what they would be in our current time in the universe. No metals meant that the stars were more opaque. So radiation could get through the star with less resistance; thus, there was less outwards pressure, meaning gravity was more effective, making the stars smaller.