Restrict Access to Logged-In Users Page Template

This could be done in a number of ways.
Please refer to the codex for further info on template hierarchy, the wordpress loop and the ‘get_template_part()’ function. The page.php is for dispalying every page. You should copy and rename it to page-restricted.php.

From the original page.php, remove this part – /* Template Name: Restrict Access*/. Be sure to include it in page-restricted.php. By this, you ensure that normally page contents are displayed, it’s only hidden when you set the Restrict Access template in the admin when editing the page.
Your code should be rewritten then thus:

<?php while (have_posts()): ?>

    <?php the_post(); ?>

    <?php if ( !is_user_logged_in() ) {

        echo "Restricted Content!";
        echo '<a href="http://example.com">Go to Home Page</a>';

    } else {

        get_template_part('content', 'single'); ?>

    } ?>

    <?php if (comments_open() && !post_password_required() && $options['comments_on_pages'] != 0) : ?>
        <?php comments_template('', true); ?>
    <?php elseif ((!comments_open() || post_password_required()) && get_comments_number() > 0): ?>
        <?php comments_template('/comments-disabled.php'); ?>
    <?php endif; ?>

<?php endwhile; ?>