How massive is the Sun compared to other stars?

The notion that the sun is an 'average' star, is a popular notion, not a scientific one. It is to my knowledge based on the spectral colour-classification (OBAFGKM..) of stars, where the sun (G2-class) hits about the center of this classification, depending how many classes one adds at the end.

However by number, the sun is not average, it is on the rarer end of the mass distribution function. See also this graphic, provided by the University of Colorado:

enter image description here

This has to do with two effects:

1. Heavier stars burn through their fuel much faster than low-mass stars.

The lifetime $t_{\rm life}$ of a star on the main sequence goes like $$t_{\rm life} \sim 10^{10}yrs \left(\frac{M}{M_{\odot}}\right)^{-2.5}$$ so you can do the math yourself how short more massive stars live.

2. Lower mass stars are formed more frequently.

In star-forming environments it is the 3D-turbulence that clumps gas together at smaller and smaller scales (as opposed to larger and larger scales). It is because of this, that there are more small clumps that become gravitationally unstable than large clumps, which then form stars of a given clump mass.