Which fan do you mean - cpu heatsink fan, power supply fan, or a case fan?
When you say "when power is off" do you mean when you shut down via your desktop or do you mean when you flip the power switch on the back of the power supply?
If you meant the power supply fan then the answer is it depends. Modern power supplies may have temperature controlled fans. If the temps are still high the fan might continue to run until the temperature decreases. However, if you flip the power switch on the back of the power supply it shuts off power completely and nothing will run.