For the Desktop version you do need to have an internet connection to activate the software, but this is a one-time process and you do not need to be online to use the core software, although you will not have access to cloud services while offline.
If you are using the 3D EXPERIENCE version of Solidworks then yes you will need a stable and consistent internet connection if accessing or storing files in the 3D Experience.
You can set up Solidworks and the 3D Experience platform to work offline for up-to 30 days.
First ensure you have a desktop shortcut for Solidworks, if you plan to be truly offline you won't be able open the 3D Experience platform to open Solidworks.
From their ensure you have no other Solidworks files open or running and open a fresh file. In the top-right corner select your initials. It should be a small circular icon, this could also be your profile picture if you have edited this.
Clicking that will give the option to 'Work Offline'. Please read the warning given and then choose how many days maximum you'd like to work offline for. You can reconnect at any time but 30 days is the maximum before you must reconnect.
To reconnect early click the icon found in the top-right of a world with a red line through it. Click this and you will be asked to reconnect.