Install Tweak Tool by these lines:
sudo apt-get install gnome-tweaks
Then, Disable the setting "Suspend when laptop lid is closed".You are done..
Alternatively, you can do these CLI (using Commands) also,
• Open Terminal and type:sudo gedit /etc/systemd/logind.conf
• Uncomment the line "#HandleLidSwitch=suspend" by removing "#" in the beginning.
• Save and exit
• Now, Restart the Systemd service to apply changes via command:systemctl restart systemd-logind.service