Suppose, for the sake of argument, that Stonewall Jackson is killed during the Battle of Chancellorsville. Having lost one of his top two commanders, would Lee have still gone ahead with the invasion of Pennsylvania? And if so, might the Army of the Potomac have actually won? Would the loss of Jackson be enough to prevent the ultimate Confederate victory?
Well, I think Lee would still have decided to take the war into the North. He didn't want to send troops west to support Vicksburg, whether rightly or wrongly, and he felt the best way to relieve Vicksburg would be with a major victory won on Northern soil, which would, or so he hoped, force the Union to withdraw some of the troops besieging Vicksburg and send them east to face Lee's Army.
As to whether the campaign would have been as successful without Jackson, probably not. It was Jackson, through his support of Longstreet during the planning conference with Lee on the evening of July 1, 1863, who persuaded Lee to withdraw from Gettysburg and find more suitable defensive ground, forcing the Army of the Potomac to attack the Army of Northern Virginia in prepared defensive positions. Had he not been there, Harry Heth's ill-advised shoe-finding expedition might have sucked the A.N.V. into a bloody slugging match with the Army of the Potomac at Gettysburg, which might have lasted 2 or even 3 days, with the Union holding all the advantageous ground. Instead, the decisive battle was fought outside Carlisle, with the Confederates firmly occupying the high ground.
Of course, the Army of the Potomac fought bravely. Hancock's Charge, however ill advised it was, was still a moment of glory for Union arms. But attacking uphill, against entrenched Confederate lines, was suicide. Who knows, if Jackson had not been there, it might have been Confederates making that charge, at Gettysburg, under the command of Heth, Pettrigrew, or even George Pickett.