The contribution of components like dark matter, stars and gas to the mass of a galaxy I am doing an introductory course in astrophysics and astronomy undergrad level.
In it we were taught that the main components of matter in a galaxy are dark matter halo ($M_h$), gas ($M_{gas}$) and stars ($M_*$). Thus the mass of the galaxy can be given as the sum of these three components. I want to read more about this but when I search this on net I don't get any appropriate results or they are very advanced. I guess this is because the actual terminology and nomenclature of these masses is different.
Thus if anyone can give me accurate terminology of these masses it would be helpful.
Additionally we were told that given the mass of dark matter halo the other two masses can have only a certain range of values. I want to know how we can determine these range of values possible for a galaxy.
Also how do these values change as the galaxy ages?
Any links to resources regarding the above topics are also welcome.
Edit 1: Regarding my question above about the change in mass of galaxies over time I am giving my thinking. Please correct me if I am wrong somewhere.
Initially galaxy consists of only dark matter and gas. This initially contracts but later undergoes segmentation to form stars. Thus initially there should be decrease in $M_{gas}$. But slowly some gas is returned as stars die and also gathered from surroundings, hence the gas mass should remain constant or decrease at a very slow rate. Now for the stars initially $M_*$ should increase due to creation of new stars. But after some time as some of the early stars start dying out there will be simultaneous birth and death of stars, hence the $M_*$ should fairly remain constant during this period. Finally as the star formation rate decreases due to depletion of $M_{gas}$ the birth of new stars will be reduced. Slowly more and more stars will start dying and $M_*$ will be depleted leaving behind only heavier elements. Hence $M_*$ should decrease during this period. Finally coming to halo mass, I am still not sure about it. I think it should not change much over the lifetime of the galaxy because dark matter does not seem to interact with the baryonic mass. I know that these changes will be slow but can anyone give me a rough number on the slowness of these changes?
This is a rather complex question, for several reasons.

First, galaxies come in many variations, regarding such diverse
properties as mass, morphology, and environment.
Second, different observational techniques, and different models,
yield different observables — you can observe the same field of the
sky with two different instruments and deduce a different
distribution of galaxies and their properties.
Third, as you mention, galaxies evolve, and you will not necessarily
obtain the same ratio between, say, gas mass and stellar mass, even for a
given galaxy type, at different redshifts.

Nevertheless, some things can be said to be true &quot;in general&quot;:
Stellar mass – gas mass relation
The more massive a galaxy is (in terms of stellar mass, $M_*$), the more efficient it is at forming stars. Hence, the gas fraction $f_\mathrm{gas} \equiv M_\mathrm{gas}/(M_\mathrm{gas}+M_*)$ decreases with $M_*$. Moreover, although part of the gas in stars is returned to the interstellar medium (ISM), as time goes, and a galaxy forms stars, it will &quot;deplete&quot; the ISM, further reducing $f_\mathrm{gas}$.
This can be seen in this plot from Magdis et al. (2012), showing the gas fraction as a function of stellar mass today (open circles) and ~10 billion years ago (closed circles):

The galaxies used in this survey are &quot;main sequence&quot; galaxies, and other selection criteria apply as well.
Stellar mass – halo mass relation
The dark matter (DM) component of a galaxy is much more extended and diffuse than the baryons (because DM is collisionless), rather lying in a large &quot;halo&quot; around the gas and stars. Of course, we cannot see DM, making measurements of its mass difficult. Only in numerical simulations, we know exactly its mass.
The larger the DM halo mass ($M_\mathrm{h}$), the more stars the galaxy has. But the relation is not straightforward. In general, $M_*$ increases with $M_\mathrm{h}$ more rapidly for low-mass galaxies, while for $M_\mathrm{h} \gtrsim 10^{12}\,M_\odot$ (roughly Milky Way-sized galaxies) the relation flattens out:
This is seen in the left panel of this plot from Behroozi et al. (2013):

The different colors correspond to different epochs in the Universe. The data is from a cosmological simulation, but the simulation was calibrated to match various observations.
Another way to show this relation is seen in the right panel, where the stellar fraction $M_*/M_\mathrm{h}$ is seen to rise until around $M_\mathrm{h} \sim 10^{12}\,M_\odot$, after which it decreases again.
Why is this? In general it is thought that star formation is suppressed at low masses because gas is more easily expelled from a shallow gravitational potential, while a high masses, active galactic nuclei become very efficient at blowing out gas, thus quenching star formation.
How are masses measured?
There are several techniques to measuring these masses.
Stellar masses are measured using known relations between the amount of stars and the amount of light from some physical process — either a single emission line, or a broader band of light. For highly star-forming galaxies, where there are still many hot O and B stars that ionize the surrounding gas, nebular lines such as H$\alpha$ or Ly$\alpha$ can be used, while for non-star-forming galaxies you can use e.g. the continuum radiation from heated dust.
The conversion depends on the assumed initial mass function of the stellar population.
Likewise, gas masses and molecular masses may be measured knowing how much light a given amount of gas emits (at a given temperature, pressure, …).
Measurements of halo masses are typically done looking at the width of various spectral lines, thus deducing the velocity dispersion $\sigma_V$ of the gas and stars. Then, the total mass $M$ can be calculated from
$$
\sigma^2 = \frac{GM}{CR},
$$
where $G$ is the gravitational constant, $R$ is the radius, and $C$ is a geometrical factor (see this answer for an explanation).