Slavery was legal in most of the 13 states in the 1700s. It was abolished in all of the Northern States, with the last state, New York, freeing all slaves by 1826.
New York took so long because there were so many slaves in New York. They numbered in the tens of thousands. I believe at the time New York voted in abolition (which was 1801 or so) they had more slaves than any other state except Virginia. New York phased out slavery over a 25-year period as I recall.
Virginia almost passed a similar law in the 1790s. Shame it did not pass. Would have changed American history significantly.
Allow me to offer a correction or two. Slavery was abolished in NY in 1827. Earlier (I think 1799) no new slaves could be brought in. Also, NY had FAR fewer slaves than in the south, where they were mainly fieldworkers, whereas in NY they were mainly house slaves. The census from 1790:
NY had 21,00 slaves and 5 colonies had more than that. See here for source
Perhaps I’m recalling poorly, but I read some years ago in the Friends of Monmouth Battlefied newsletter (”Battle Cry”) about slavery in NJ. This is because they often present local history as well, if it is close to the battle site. In this case, they were talking about 1 of the towns (defunct?) being basically a black town. In there was discussion how angry whites were that slavery was to be abolished in the 1830s (not the ‘20s, the ‘30s).