Yes, the timing is strongly correlated to the end of the war. Russia's interest in selling Alaska was driven by the outcome of the Crimean War, which demonstrated its inability to defend its Pacific coast against a European threat. Alaska stayed neutral as a result of negotiations between the Russian-American Company and the Hudson Bay Company, which exerted enough political pressure to get that neutrality accepted by the British government.
In 1858, the Treaty of Aigun allowed Russia to seize territory north of the Amur River. In 1860, the Treaty of Peking allowed Russia to take a larger portion of Pacific Asian coast, including the present site of Vladivostok.
This new territory was more accessible to Russia and yet appeared to offer the same opportunities for expansion that Alaska did.
On the American side, Secretary of State William Seward was a firm believer in Manifest Destiny, the idea that the United States was destined to control all of North America. As anchors for that concept, Seward wanted to acquire Hawaii, Alaska, Greenland and several Caribbean islands. Those four acquisitions, he believed, would allow the United States to both control North America and project power overseas east and west.
Thus, there was an interest in selling (on the Russian side) and acquiring (on the American side) as soon as the Lincoln administration began. Of course, Seward (and the rest of Lincoln's cabinet) found themselves consumed by the need to prosecute the American Civil War.
At the end of the war, Seward was critically injured in an accident, then suffered severe wounds as part of an assassination attempt on the same night that Lincoln was killed. After he recovered, he began negotiations in earnest, and these progressed quickly.
The assassination of Lincoln meant the conservative Andrew Johnson was president, and he was adamantly opposed by a progressive Republican Congress that was entrenched in opposition. This meant even generally popular ideas, like the acquisition of Alaska, moved slowly and only with generous bribes supplied by the Russian government.
That's why the Alaska Purchase was completed in 1867 and not sooner.