He answered your question.
You put it in the theme file the same way you would if you put it in any other file. If you can create a link inside a plain old regular HTML page, you can create a link inside a theme file.
What more do you need -- a link is a link is a link.
I love <a href="http:///www.cookies.com">cookies</a>
Depending on were you want to display your link and on what pages, you need to add your link(s) to your theme file, inside the loop.
About the loop:
Crack open your theme files, and take a look. If you have your website open in a browser window,and a theme file open in the other window, it tends to be pretty easy figuring out what causes what..
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
or something similar, displays all the posts titles,and permalink.
<small><?php the_time('F jS, Y'); ?></small>
That or something similar is going to show the time of the post.
<?php the_content(); ?>
thats the content of your post.
If you want to put your link after your content, thats what you are looking for. And yes you will need to use the typical method of counting posts to do exactly what you want.
There are hundreds of threads already here on how to count posts for the purposes of adding, for example, google adsense or whatever.