The desorption of heavy oil is one of the important indicators affecting the development efficiency of the remaining oil in nanopores. However, the study of the adsorption and diffusion mechanisms of heavy oil molecules in nanopores remains scarce. In this work, the influences of temperature on the adsorption and diffusion properties of the heavy oil four-fractions in quartz nanopore have been investigated via molecular dynamics simulations. Our results show that the heavy oil molecules will form a denser multilayer adsorption oil layer on the nanopore surface, and high temperature can alter the adsorption behaviors of the heavy oil four-fractions. As the temperature increases, the saturate molecules are desorbed from the nanopore surfaces, but the aromatic, resin, and asphaltene molecules maintain a tendency to aggregate towards the nanopore surface. In particular, the agglomeration behaviors of most saturate, aromatic and asphaltene molecules in nanopore can be suppressed by the confined space compared with the heavy oil molecules in oil droplet. In addition, the influence of temperature on the movement of heavy oil molecules in nanopore decreases compared with the oil molecules in a heavy oil droplet due to the confined space and adsorption effect. Interestingly, there is a competition phenomenon between the adsorption and diffusion of aromatic, resin, and asphaltene molecules in the nanopore, resulting in different adsorption behaviors with the increase in temperature. The results obtained in this paper will provide molecular-level theoretical guidance for understanding the adsorption and desorption mechanisms of heavy oil in nanopores.