I had a laptop offline. Hasn't been online for months. I booted it up, only to find my password didn't work. Couldn't log on. Then I noticed my laptop Wifi switch was on. (The laptop was bought in 2011 and is a Compaq and has a key that doubles as a function key, which has a green light if the Wifi is switched on and a red if it isn't. It was green. I must have accidentally hit that key sometime back and didn't notice.) There are many apartments here that use Wifi. My other PC that is sometimes online (but never using Wifi but a phone line) sees the other users and their names. Could someone sitting in their apartment using Wifi have seen my computer and have hacked my password and reset it so I can't log on? If so, what information could they have stolen from my laptop, if any? Could they have stolen files and documents?
With the limited details, the best answer is "probably not," though it is possible.
As a number of the commentators have said, first questions are: are you sure you have the correct password, have you checked if the caps lock key is on, does anyone else have physical access to the computer who might have changed it?
All of these scenarios are much more likely.
In answer to your second question, if you were hacked via wifi, to the extent the attacker could change your password, then best to assume they could have gotten anything off your computer which your account had access to, including files and documents.
I had a laptop offline. Hasn't been online for months. I booted it up...
Assuming your laptop is running Windows you would need to actively connect to a WiFi network while logged in. Since you are unable to do so the OS has no way of connecting to a wireless network.
The WiFi indicator (the green light) shows that the laptop has wireless networking enabled. This does not mean that the laptop is connected to WiFi.
Could someone sitting in their apartment using Wifi have seen my computer and have hacked my password and reset it so I can't log on?
No. If your laptop is offline or switched off it cannot interact with other computers wirelessly.
In regards to the enable wireless communication button.
I must have accidentally hit that key sometime back and didn't notice.
You would still need to connect to a wireless network for somebody to hack your laptop.