I'm new to laptops and when I turned mine on, it automatically connected to the internet using, apparently the neighbor's internet connection. I want to know if this is legal or not.

I know this is a newbie question.