Yes, if you want to use RealVNC Connect's cloud connectivity.
Both endpoints (that is, the remote device running RealVNC Server you want to control, and the device you’re sitting in front of and want to control from running RealVNC Viewer) need to be connected to the Internet, and able to communicate with RealVNC Connect's cloud services.
Some RealVNC subscriptions are licensed online and therefore require RealVNC Viewer and RealVNC Server to be connected to the Internet.
If your subscription includes offline licensing and want to establish direct connections only, then endpoints need only be Internet-connected if you’re actually routing the connection over the public Internet.
If you’re routing over a private TCP/UDP network such as a LAN or VPN, there’s no such requirement. Neither RealVNC Server nor RealVNC Viewer ‘phone home’ when offline licensing is used.