Sample size is calculated with a Power analysis which is an important aspect of any quantitative study. Power is defined as the probability that a statistical significance test will reject the null hypothesis sample size is the number of participants needed to be included in your study. It should be adequate to provide a desirable power of detecting a significant effect of a given magnitude if such effect actually exits.

The information essentially needed for calculating the sample size are three.
(1) the minimum difference you wish to detect as significant.
(2) The value of standard deviation in case of continuous variable or estimated value of the smaller proportion in case of proportion
(3) Type 1 error (alpha) and type 2 (beta error) . It takes very large samples to detect very small differences but small samples to detect large differences. So be careful to specify the size of the effect you are trying to detect.