What if Stalin died unexpectedly some time in 1941? Probably of a stroke.
Before or after 22 June? It makes a huge difference.
Before - even a week before: Stalin's order to the Red Army to remain "stood down" and avoid any provocation to the Germans is rescinded. The Red Army goes on full alert.
When the German attack comes on 22 June, it meets heavy resistance at all points on the ground and in the air. The Germans are better and they win - but instead of rolling forward 30-50 km against minimal effective resistance, encircling and annihilating the entire forward echelon of Soviet forces, they slog through. And where in OTL the disaster at the border left the Soviets unable to form effective resistance for weeks, while the Germans pushed forward, encircling and destroying more troops, the border battles are followed by another month of heavy fighting.
Axis forces eventually reach the line Riga-Smolensk-Kiev, having lost about 1M men while the Soviets lose about 3M. In OTL Axis casualties were half that, while Soviet casualties were double. Come winter, the Soviets start pushing back.
The war ends in 1944. It will still end much as OTL, with the Allies and Soviets meeting in the heart of Germany - because the Germans will strip Africa, Italy, and France to hold off the Soviets until the US/UK are coming over the Rhine.
After June 22? Say in early August? Not clear. It's possible that Stalin's successor(s) may not have the nerve to stop the Moscow Panic; that they may sue for peace. It depends on who wins the succession battle.