The estimated stellar masses of galaxies are widely used to characterize how the galaxy population evolves over cosmic time. If stellar masses can be estimated in a robust manner, free from any bias, global diagnostics such as the stellar mass function can be used to constrain the physics of galaxy formation. We explore how galaxy stellar masses, estimated by fitting broad-band spectral energy distributions (SEDs) with stellar population models, can be biased as a result of commonly adopted assumptions for the star-formation and chemical enrichment histories, recycled fractions and dust attenuation curves of galaxies. We apply the observational technique of broad-band SED fitting to model galaxy SEDs calculated by the theoretical galaxy formation model GALFORM, isolating the effect of each of these assumptions. We find that, averaged over the entire galaxy population, the common assumption of exponentially declining star-formation histories does not adversely affect stellar mass estimation. We show that fixing the metallicity in SED fitting or using sparsely sampled metallicity grids can introduce mass dependent systematics into stellar mass estimates. We find that the common assumption of a star-dust geometry corresponding to a uniform foreground dust screen can cause the stellar masses of dusty model galaxies to be significantly underestimated. Finally, we show that stellar mass functions recovered by applying SED fitting to model galaxies at high redshift can differ significantly in both shape and normalization from the intrinsic mass functions predicted by a given model. Given these differences, our methodology of using stellar masses estimated from model galaxy SEDs offers a new, self-consistent way to compare model predictions with observations.