We study the occupation numbers and number fluctuations of ultracold atoms in deep optical lattices for finite-temperatures within the Bose-Hubbard model. Simple analytical expressions for the mean occupation number and number fluctuations are obtained in the weak-hopping regime using an interpolation between results from different perturbation approaches in the Mott-insulator and superfluid phases. With this approach the magnitude of number fluctuations under a wide range of experimental conditions can be estimated and the properties of the finite-temperature phase diagram can be studied. These analytical results are compared to exact one-dimensional numerical calculations using a finite temperature variant of the density-matrix renormalization group (DMRG) method and found to have a high degree of accuracy. We find very good agreement, also in the crossover “thermal” region. We also analyze the influence of finite temperature on the behavior of the system in the vicinity of the zero-temperature phase transition, in one, two, and three dimensions.