I've heard most of galaxies are spiral or ellipsoid shaped. Is it true?
If true, then why they form in such shapes?
How did arms of the spiral galaxies form?
Yes, Galaxies come in three main types: ellipticals, spirals, and irregulars. They is a system called Galaxy morphological classification; used by astronomers to divide galaxies into groups based on their visual appearance. There are several schemes in use by which galaxies can be classified according to their morphologies, the most famous being the Hubble sequence, devised by Edwin Hubble.
There isn't a clear or a known answer why they form , there are several studies and researches concerning this question. The study of galaxy formation and evolution is concerned with the processes that formed a heterogeneous universe from a homogeneous beginning, the formation of the first galaxies, the way galaxies change over time, and the processes that have generated the variety of structures observed in nearby galaxies. It is one of the most active research areas in astrophysics.
3.Spiral arms are regions of stars that extend from the center of spiral and barred spiral galaxies. These long, thin regions resemble a spiral and thus give spiral galaxies their name. Naturally, different classifications of spiral galaxies have distinct arm-structures. Sc and SBc galaxies, for instance, have very "loose" arms, whereas Sa and SBa galaxies have tightly wrapped arms (with reference to the Hubble sequence). Either way, spiral arms contain a great many young, blue stars (due to the high mass density and the high rate of star formation), which make the arms so remarkable. Source.
Most of the big, bright, noticeable galaxies are either spiral or elliptical, yes. However, there are certainly irregular galaxies, and they may very well be the most numerous.1 The thing is, we can only see the very closest "dwarf" galaxies, most of which do not display a nice elliptical or spiral structure. Indeed, the two closest galaxies of note to us are the Magellanic Clouds, which are irregularly shaped satellites of our Milky Way visible from the southern hemisphere. I think you'll agree that the Small Magellanic Cloud, as seen in the below NASA image, is neither spiral nor elliptical.
Galaxy formation is still not entirely settled. However, we can say a few things about the different shapes. Spiral galaxies tend to have coherent angular momentum. By that I mean most of the stars orbit in about the same plane in the same direction. This is what you expect when drag forces are present, and indeed spiral galaxies tend to have lots of gas and dust. Contrast this with ellipticals, where there are orbits going in all different directions. Also, ellipticals have very little gas and dust, so there is nothing stopping stars from going in opposing directions - there is no headwind so to speak.
Spiral arms are actually a very complicated topic, requiring rather advanced dynamics to fully understand. Some of the most important points we have learned, however, are the following:
- The spiral pattern does not move at the same rate as the stars move. This was first realized when people noticed the angular speed of stars in a spiral galaxy varies with radius. Thus the arms would wind up over time.
- Rather, they are more akin to density waves in the interstellar medium. Think of them as sound waves propagating through the disk, which itself happens to be rotating.
- The overdensity in an arm probably causes a burst of star birth, which will include a number of relatively short-lived, bright, blue stars. Thus the light from these stars traces the wave.
- Spiral structure may very well be a transient phenomenon that lasts some time, grows too chaotic, and then eventually reforms. This applies especially to...
- ...bars, which are found in most spiral galaxies today, including our own. NASA again took a beautiful picture with the Hubble telescope to demonstrate this, this time of NGC 1300.
1 Some sources will claim otherwise, but be careful to distinguish between volume-limited surveys (which do a "fair" sampling of everything out to a certain distance) and magnitude-limited surveys (which record whatever we can see, even though we can see large spirals and ellipticals further away than we can see dwarf irregulars).
Yes most galaxies are spiral,elliptical and bared. The reason for this is the same reason planets orbit stars; gravity. Before the universe had "structured" galaxies masses of gas and dust could just clump together and probably created a massive star with a short lifetime, after the stars life it is likely that it would turn into a black hole. (A super massive black hole to be precise) which then pulls in a load of other gas and dust along with a few other elements it spat out when it turned supernova. These clumps slowly formed bigger clumps until the same thing happened on a smaller scale and stars with longer life times were produced. Of course these are stil being pulled towards the super massive black hole and they begin to travel faster and faster. Some of these stars would be sucked straight to the middle of the black hole while others would just escape it and begin to orbit it. This is how they get their shape. As for the arms instead of the stars all being even distances apart some would be heavier and pull themselves towards each other to form clumps among them.
Adding to the answer of the question 3 (How did arms of the spiral galaxies form?) one of the theories suggest an encounter between galaxies. This simulation I found in other answer "shows the influence of a nearby galaxy causing the imbalance which triggers arm formation" and could be interesting to see.