Colloids immersed in a critical or near-critical binary liquid mixture and close to a chemically patterned substrate are subject to normal and lateral critical Casimir forces of dominating strength. For a single colloid we calculate these attractive or repulsive forces and the corresponding critical Casimir potentials within mean-field theory. Within this approach we also discuss the quality of the Derjaguin approximation and apply it to Monte Carlo simulation data available for the system under study. We find that the range of validity of the Derjaguin approximation is rather large and that it fails only for surface structures which are very small compared to the geometric mean of the size of the colloid and its distance from the substrate. For certain chemical structures of the substrate the critical Casimir force acting on the colloid can change sign as a function of the distance between the particle and the substrate; this provides a mechanism for stable levitation at a certain distance which can be strongly tuned by temperature, i.e., with a sensitivity of more than 200nm/K.