If your AC compressor is engaging with the heater on, there's a problem with the system's controls or wiring. This could be caused by:
* Faulty blend door actuator: This component controls the mix of hot and cold air. A malfunction could cause the system to think AC is needed even when the heater is selected.
* Wiring issue: A short circuit or faulty wiring harness could be sending incorrect signals to the compressor clutch.
* Control module problem: The vehicle's climate control module might be malfunctioning, sending incorrect signals to the compressor.
* Low refrigerant: While less likely to cause it to cycle *with* the heater, extremely low refrigerant *could* cause erratic behavior.
You should take your 2002 Dodge Ram to a qualified mechanic to diagnose and repair the issue. Continuing to run the AC compressor unnecessarily will put extra strain on the system and could lead to further damage.