An AC compressor on a vehicle should easily last 8 to 10 years before it needs replaced depending on how often you run the AC in the vehicle.
In most cases an AC compressor on a vehicle lasts the life of the vehicle before it ever needs to be replaced but sometimes there could be a failure before then because things can happen and cause it to seize up.
To replace the AC compressor on the vehicle it needs to have the refrigerant recovered and then the AC compressor will need a vacuum pulled on it and compressor oil added to it and then refilled with refrigerant which should be done by a qualified AC technician.