We present the results of an experiment on measuring the gradient of the Casimir force between an Au-coated hollow glass microsphere and graphene-coated fused silica plate by means of a modified atomic force microscope cantilever based technique operated in the dynamic regime. These measurements were performed in high vacuum at room temperature. The energy gap and the concentration of impurities in the graphene sample used have been measured utilizing scanning tunnelling spectroscopy and Raman spectroscopy, respectively. The measurement results for the gradients of the Casimir force are found to be in a very good agreement with theory using the polarization tensor of graphene at nonzero temperature depending on the energy gap and chemical potential with no fitting parameters. The theoretical predictions of the same theory at zero temperature are experimentally excluded over the measurement region from 250 to 517 nm. We have also investigated a dependence of the thermal correction to the Casimir force gradient on the values of the energy gap, chemical potential, and on the presence of a substrate supporting the graphene sheet. It is shown that the observed thermal effect is consistent in size with that arising for pristine graphene sheets if the impact of real conditions such as nonzero values of the energy gap, chemical potential, and the presence of a substrate is included. Implications of the obtained results to the resolution of the long-standing problems in Casimir physics are discussed. In addition to the paper published previously [M. Liu {it et al}., Phys. Rev. Lett. {bf 126}, 206802 (2021)], we present measurement results for the energy gap of the graphene sample, double the experimental data for the Casimir force, and perform a more complete theoretical analysis.