As far as I understand it, a sequel is a direct continuation of the story, while a spin-off is a separate story placed in a world with the same core elements. The difference between that and a fanfic is that a spin-off is a sort of individual take on what a story could have looked like if <insert crucial part of the setting that differs from the original story>, typically with a completely separate main characters and plot. A fanfic meanwhile is an individual take of what could have happened if the same story went differently, or if the same character did different things, possibly in a different setting.
Also, a spin-off can be written by a different author. A sequel technically can as well, but... yeah, it's extremely rare.