The fans kick in at a pre-determined temperature to cool the engine whilst running and comes off when at another temp(lower). The mostly come on at low speeds or in traffic jams. When you have been out driving and come home you are driving slower, usually, so the engine temp goes up and the fans kick in. When you turn the engine off the, temp is still not cool enough, so the fans keep running.
Don't worry, its normal for this to happen