A detailed analysis of the finite-size effects on the bulk critical behaviour of the $d$-dimensional mean spherical model confined to a film geometry with finite thickness $L$ is reported. Along the finite direction different kinds of boundary conditions are applied: periodic $(p)$, antiperiodic $(a)$ and free surfaces with Dirichlet $(D)$, Neumann $(N)$ and a combination of Neumann and Dirichlet $(ND)$ on both surfaces. A systematic method for the evaluation of the finite-size corrections to the free energy for the different types of boundary conditions is proposed. The free energy density and the equation for the spherical field are computed for arbitrary $d$. It is found, for $2<d<4$, that the singular part of the free energy has the required finite-size scaling form at the bulk critical temperature only for $(p)$ and $(a)$. For the remaining boundary conditions the standard finite-size scaling hypothesis is not valid. At $d=3$, the critical amplitude of the singular part of the free energy (related to the so called Casimir amplitude) is estimated. We obtain $Delta^{(p)}=-2zeta(3)/(5pi)=-0.153051...$, $Delta^{(a)}=0.274543...$ and $Delta^{(ND)}=0.01922...$, implying a fluctuation--induced attraction between the surfaces for $(p)$ and repulsion in the other two cases. For $(D)$ and $(N)$ we find a logarithmic dependence on $L$.