This will depend on the copyright policies of your publisher, the rights you retained through your publication agreement, and the version of the work you’d like to share.
Some publisher agreements allows authors to archive pre-prints (your manuscript prior to peer review), and/or post prints (your final peer-reviewed manuscripts). Open Access journals often allow you to retain copyright over your article with very few or no restrictions (authors are often able to freely share the PDF of the final article). Publishers may also specify conditions such as where you can archive, how soon after publication, and how to cite the resource when archiving.
The best way to determine what you can do is to read your publication agreement. You can also refer to SHERPA/RoMEO, which provides details of the archiving rights normally given by the publishing agreements of various publishers. SHERPA/RoMEO ranks publishers on the following scale: