First check your default settings. Go to Settings > System > Power & Sleep. Here you can verify time-out for your screen, and sleep timing. The default is set to 10 minutes for screen timeout, and 30 minutes for sleep mode.
If these settings look correct and your machine is still going to sleep in 2 minutes you will have to edit your Windows 10 registry. Editing the registry will allow you to open up an unattended sleep mode menu item which is currently hidden by default.
Type WIN + R and then type regedit and hit Enter.
Find the folder located below:
Double click on Attributes and enter 2 as value.
Now, Open Settings and search for “power plan“. Select Edit Power Settings from the result. Open the link which says change advanced power settings. In the next window, navigate to Sleep > System unattended sleep timeout. Change these settings to whatever times you want your computer to really sleep.