No. It took some time to settle matters after the surrender and get enough states to ratify the 13th Amendment. During the war, slavery was still legal in Confederate areas controlled by the Union.
Except that slavery still existed in so called “union states” before and after the war.