ESP8266 and its "old brother" ESP32 are chips. NodeMCU is a chip with some peripherials: recommended.
There are many - really many - possible usages for a reasonably powerful processor that can establish connection with both peripherials and PC using more than one protocol and can be programmed using more than one language. So I will only list what I consider most useful.
1. It can be used anywhere the Arduino can.
2. It can run a simple Web server in your local (between devices that use WiFi served with your router)
network.
3. It can be used as a router, though it is not recommended due to security reasons.
4. It can use Sockets and Server Side Events: both allow "pushing" data from server to
client, which means that you don't have to keep sending request to server by timer.
5. It can get to the "outer" Internet, for example, to get exact time.
6. It even has a slot for SD card and can run a file system.
There are many ways to program NodeMCU. It understands LUA, Python... But by all means, Arduino's C++ is the most used.
To run it, you need a plug-in for Arduino IDE, allowing it to "understand" the ESP8266 board.
1. In your Arduino IDE, go to File> Preferences
2. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into the "Additional Boards Manager URLs"
field as shown in the figure below. Then, click the "OK" button.
3. Note: if you already have the ESP32 boards URL, you can separate the URLs with a comma as follows:
https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
4. Open the Boards Manager. Go to Tools > Board > Boards Manager
5. Search for ESP8266 and press install button for the "ESP8266 by ESP8266 Community".
That's it. It should be installed after a few seconds.