Developing the nonequilibrium thermodynamics of friction is required for systematic design of low-friction surfaces for a broad range of technological applications. Intuitively, the thermodynamic work done by a material sliding along a surface is expected to be partially dissipated as heat and partially transformed into the change of the internal energy of the system. However, general nonequilibrium thermodynamic principles governing this separation are presently unknown. We develop a theoretical framework based on the transition state theory combined with the conventional Prandtl-Tomlinson model, allowing to set explicit expressions for evaluating the heat dissipation and internal energy change produced during the frictional stick-slip motion of a tip of a typical friction force microscope. We use the formalism to quantify the heat dissipation for a range of parameters relevant to materials in practical applications of nanoscale friction