assumed as comment line

Firstly, in the for there is missing a ‘$’. It should read: for ( $i = 1; $i <= $im; $i++ ).

Secondly, in order to use the page link(s), you need to call the function wp_link_pages().

$im = stripslashes( get_option( 'tm_alim' ) );
for ( $i = 1; $i <= $im; $i++ )
    echo "<img alt="" src="http://sitename.com/" . $i . "/00"  . $i . ".jpg" />"
        . "<!--nextpage-->";
wp_link_pages();

See Page-Links for further information.

// Edit

You cannot use <!--nextpage--> inside template files, so you have to do it by any other means.

You could for instance provide the image with an id and alter the source when clicking on the link.

A quick-and-dirty set up could look like the following code:

echo "
    <script>
        var i = 1;
        function nextImage() {
            if ( ++i <= " . stripslashes( get_option( 'tm_alim' ) ) . " )
                document.getElementById('my-slideshow').src="http://sitename.com/" + i + '/00' + i + '.jpg';
        };
    </script>";
echo '<img id="my-slideshow" src="http://sitename.com/' . $i . '/00'  . $i . '.jpg" />';
echo '<a onclick="javascript:nextImage()" style="cursor:pointer;">next image</a>';

Of course you can also use jQuery if you already use it (or want to use it for that purpose).