Yeah, you can do that. The printer has a mode called Wi-Fi Direct. It acts as its own little wireless access point for up to 4 devices.
You just need to enable Wi-Fi Direct Mode from the printer's control panel. Look for the Wi-Fi or network settings menu. Once it's on, your laptop should see the printer's own network name (SSID) in its list of available Wi-Fi networks. Connect to it, and you should be able to print directly.
Heads up: When you're in Wi-Fi Direct mode, the printer won't be on your main home Wi-Fi network. So you can't print to it from other devices on your home network at the same time.