How/where do I add $('#fullpage').fullpage() code?
You need to create a javascript file in your theme and attach it to pages as shown in the documentation.
https://www.drupal.org/docs/8/theming-drupal-8/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-theme

Make sure you theme library has a dependency on fullPage.