It depends where you are. At the time of writing, VPNs are illegal in Russia, China, Iran, Iraq, UAE, Oman, Belarus, North Korea, Turkmenistan and Turkey, but they are completely legal everywhere else. Of course, if you use a VPN in order to commit a crime, this will still be a crime. That includes torrenting copyrighted content, hacking into a network without authorization, buying or selling illegal weapons and drugs, and cyberstalking. But it is not a crime to use a VPN to visit a website if the website itself is legal under your country’s laws. If the website contains geo-restricted content, it’s typically the responsibility of the website owner to make sure they display the right stuff as per their licensing agreements.