We investigate the in-medium masses of D and (D) over bar mesons in the isospin-asymmetric nuclear matter at finite temperatures arising due to the interactions with the nucleons, the scalar-isoscalar meson sigma, and the SU(4) case due to the large charm quark mass, we use the SU(4) symmetry here only to obtain the interactions of the D and (D) over bar mesons with the light hadron sector but use the observed values of the heavy hadron masses and empirical values of the decay constants. The in-medium masses of J/psi and the excited charmonium states [psi(3686) and psi(3770)] are also calculated in the hot isospin-asymmetric nuclear matter in the present investigation. These mass modifications arise due to the interaction of the charmonium states with the gluon condensates of QCD, simulated by a scalar dilaton field introduced to incorporate the broken scale invariance of QCD within the effective chiral model. The change in the mass of J/psi in the nuclear matter with the density is seen to be rather small, as has been shown in the literature by using various approaches, whereas the masses of the excited states of charmonium [psi(3686) and psi(3770)] are seen to have considerable drop at high densities. The present study of the in-medium masses of D ((D) over bar) mesons as well as of the charmonium states will be of relevance for the observables from the compressed baryonic matter, like the production and collective flow of the D ((D) over bar) mesons, resulting from the asymmetric heavy-ion collision experiments planned at the future facility of the GSI Facility for Antiproton and Ion Research. The mass modifications of D and (D) over bar mesons as well as of the charmonium states in hot nuclear medium can modify the decay of the charmonium states (Psi', chi(c), J/Psi) to D (D) over bar pairs in the hot dense hadronic matter. The small attractive potentials observed for the (D) over bar mesons may lead to formation of the (D) over bar mesic nuclei.