How to calculate crystal field stabilisation energy? How to calculate it? I know that it depends on the coordination compound and the number of electrons present in t2g and eg orbitals and the final answer is expressed in terms of crystal field splitting parameter. But, how to know how many electrons are there in t2g and eg orbitals?

I think rather than a broad answer and example would help. So, consider the compound $\ce{[Ni(CO)4]}$ and how to calculate CFSE for it?
Step 1: Look up Nickel Carbonyl and find out what geometry it has. 


We need the geometry to know how the $d$ orbitals will split in the ligand field. The geometry can also be predicted: late transition metals with strong field ligands tend to be tetrahedral. 




  Step 2: Find the appropriate crystal field splitting diagram for this geometry.





  Step 3: Figure out how many $d$ electrons there are. 


Nickel is in Group 10, with a configuration of $\ce{[Ar]}4s^2 3d^8$ or $\ce{[Ar]}4s^1 3d^9$. In coordination compounds we will consider this configuration to become $\ce{[Ar]}4s^2 3d^8 \implies \ce{[Ar]}3d^{10}$. The $s$ electrons are considered to move to the $d$ sub-shell in bonding - bonding need not represent ground state atomic electron configurations just group state molecular electron configurations. For more information on $d$ electron count, go to this Wikipedia page.


  Step 4: Fill in the $d$ electrons.


You can do this part yourself. How do you put 10 $d$ electrons in the orbital diagram?


  Step 5: Determine $\Delta E$.


$\Delta$ is the energy different between the $e_g$ and $t_{2g}$ sets of orbitals. This Wikipedia page walks through an octahedral complex. In tetrahedral complexes, the energy of the $e_g$ orbitals is lower and the energy of the $t_{2g}$ orbitals is higher. The energies are:


$e_g \ (d_{x^2-y^2},\ d_{z^2}) \ E=-\frac{3}{5}\Delta_\textrm{tet}$ (stabilized)
$t_{2g} \ (d_{xy},\ d_{xz},\ d_{yz}) \ E=\frac{2}{5}\Delta_\textrm{tet}$ (destabilized)


Then multiply the numbers of electrons in the orbitals by the stabilization/destabilization values, and sum.

$$\Delta E = 4\times\left(-\frac{3}{5}\Delta_\textrm{tet}\right)+6\times\left(\frac{2}{5}\Delta_\textrm{tet}\right)=?$$