Install GNOME Tweak Tool and go to the Power section. There's an option to disable the automatic suspend on lid close.
dconf before and after to find the option, but it turns out that's not how it's implemented. Instead, Tweak Tool creates
~/.config/autostart/ignore-lid-switch-tweak.desktop. The autostart is a script which effectively runs
systemd-inhibit --what=handle-lid-switch. So we can see the lid close action is handled purely by systemd-logind.
An alternative would be to edit
/etc/systemd/logind.conf to include:
This would work all the time, not just when your user is logged in.