How are galaxies, stars, and planets formed? In what order are they typically formed?
The order is galaxies, stars, planets.
There is no consensus on how galaxies are formed. Either they formed from the collapse of a cloud of matter under its own weight.
That collapse produces lumps of matter which further coalesce to form smaller lumps, which are stars. Planets are formed last, after stars, which further coalesce under their own weight, synthesize atoms of increasingly greater weight by nuclear fusion, before exploding and releasing cold heavy atoms such as those found in planets and asteroids.
The second hypothesis is that galaxies were formed from lumps of matter that existed initially in the universe.
The way gravitation works is by accretion, that is from large to small scale, which is the opposite of what intuition would tell us. Humans build structures from small to large. That's because these structures are held together by electromagnetic forces, such as chemical bonds, not by gravitational forces.
It is important to underline this fact because, in astronomy in particular, every day intuition is often misleading. This is due to the fact that gravity is strong only at large scales (and at Planck scale) and these scales are so large compared to human scales that we have no direct experience of gravity, other than weight, in our everyday life.