Are you able to connect and stay connected if you use an Ethernet cable? If so, then connect that way when it is convenient.
In order to fix the problem, go into Device manager, and do an update on the driver for the Wifi device. Hopefully that will fix it.
Since your computer is brand new, you should be able to get warranty coverage for this issue. In the meantime, you could get a USB wifi adapter. Some of them are so small that you can barely see them while they are plugged into the USB port. Here is one that you won't even notice when it is plugged into your USB port:
I have no idea how well it works; but the benefit of this one is that it stays completely out of the way when it is plugged in. But such a small adapter might not get a very good signal. In fact, some of the comments say that this is a problem with this adapter.
I have this adapter:
It works very well. You can move the adapter around to get the best signal, because it has a USB extension cable and a stand. Or, you can plug it directly into the computer, which may mean that you won't get as good of a signal.
A USB wifi adapter is a good thing to have around. You can use it if your built-in wifi fails, or if you don't have a wifi adapter in your computer and there is no Ethernet connection to plug into.