What are the rules or guidelines about posting links -- especially in answers?
Don't link to the top-level page (the home page) of a web site.
For example, the following would be an example of a bad link:
You can find an answer to your question on http://example.com
In contrast, this link (to a specific page or topic of a web site) is helpful:
For more on this topic, see http://example.com/specific-topic
Links must be relevant to the OP's specific question.
For example, the following would an example of a bad link (see also Answers vs Advice):
You can find your own answers to every question by following the instructions at http://example.com/meditation
Another example of a bad link (because this kind of link is used to advertise web sites):
By the way, you can also post this or any other question at http://example.com
Include the title of the linked page in the hyperlink.
These (better-formatted) links are easier to read, help to tell the reader (the title of) what is being linked to, and may make it easier to fix the link if the URL changes in future.
For the same reason, instead of
a link [like this](http://example.com/specific-topic)we may prefer
a link like this: [Specific Topic](http://example.com/specific-topic).
Include a quote from the linked page.
It says at https://meta.stackoverflow.com/tags/link-only-answers/info that
A link to a potential solution is always welcome, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.
An answer should be more than only a hyperlink.
At a minimum, see also "Include a quote from the linked page" above; or add a sentence to summarise what you're linking to.
Disclose if you're connected with (e.g. if you're the author or administrator of) the site you're linking to.
The following is a simple example of how to comply with this:
For further details, see my article at http://example.com/specific-topic.
See also How to not be a spammer.
There are rare (very few) exceptions to the above guidelines.
You may link to another Stack Exchange site, in a comment.
For example, you might comment, "You can also ask questions about visas on
Some few questions specifically invite links to web sites.
You may include some links (or almost anything else) in your user profile; but not in every answer.
See also "Do not use signature, taglines, or greetings" on this page: What kind of behavior is expected of users?