You can choose the action in the system settings when you close the lid of you laptop/notebook computer while you are logging on.
Nevertheless, your PC may be suspended when you close the lid of it while you have logged off.
However, you can avoid it.
$ grep Lid /etc/systemd/logind.conf
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#LidSwitchIgnoreInhibited=yes
Copy the first line, comment out it, and change the "suspend" to "ignore" by the following command.
$ sudo gedit /etc/systemd/logind.conf
or
$ sudo vi /etc/systemd/logind.conf