After typing your message on either a user's talk_page or in an article's discussion page, click on the button second from the right at the top of the editing window.
This will add a "--~~~~" wherever you left the cursor. Alternatively, you can type "--~~~~" yourself at the end of your comments.
When you save the page, the "--~~~~" will automatically turn into a link to your userpage and a timestamp in Pirate Time.