Context. Classical T Tauri stars (CTTs) magnetically interact with their surrounding disks, a process that is thought to regulate their rotational evolution. Aims. We compute torques acting onto the stellar surface of CTTs arising from different accreting (accretion funnels) and ejecting (stellar winds and magnetospheric ejections) flow components. Besides, we compare the magnetic braking due to stellar winds in two different systems: isolated (i.e., weak-line T Tauri and main-sequence) and accreting (i.e., classical T Tauri) stars. Methods. We use 2.5D magnetohydrodynamic, time-dependent, axisymmetric simulations, computed with the PLUTO code. For both systems the stellar wind is thermally driven. In the star-disk-interaction (SDI) simulations the accretion disk is Keplerian, viscous, and resistive, modeled with an alpha prescription. Two series of simulations are presented, one for each system (i.e., isolated and accreting stars). Results. In classical T Tauri systems the presence of magnetospheric ejections confines the stellar-wind expansion, resulting in a hourglass-shaped geometry of the outflow and the formation of the accretion columns modifies the amount of open magnetic flux exploited by the stellar wind. These effects have a strong impact on the stellar wind properties and we show that the stellar wind braking is more efficient in the star-disk-interacting systems than in the isolated ones. We further derive torque scalings, over a wide range of magnetic field strengths, for each flow component in a star-disk-interacting system (i.e., magnetospheric accretion/ejections, stellar winds), which directly applies a torque on the stellar surface. Conclusions. In all the performed SDI simulations the stellar wind extracts less than 2% of the mass accretion rate and the disk is truncated up to 66% of the corotation radius. All simulations show a net spin-up torque. We conclude that in order to achieve a stellarspin equilibrium we need either more massive stellar winds or disks being truncated closer to the corotation radius, which increases the torque efficiency of the magnetospheric ejections.