Yes, you can either connect your PS3 controller to your PC via USB or connect via Bluetooth.
If you wish to connect by Bluetooth, make sure your PC either has built-in Bluetooth capabilities, or you can purchase a USB Bluetooth receiver dongle. Make sure you utilise 'ScpToolkit' to help your PS3 controller connect with Bluetooth, you can download the latest version here - https://github.com/nefarius/ScpToolkit/releases