Getting credit for sharing datasets is similar to getting credit for publishing an article. You should cite other peoples data and they should cite your data.
Many journals are making a commitment to have the data underlying a particular publication made openly available before the article is published.
Some of the most notable journals that have Open Data Policies include:
In some cases journals will have a specific repository that they want researchers to use while in other cases they may just want the data made publicly available somewhere with with a persistent identifier (such as a DOI).
Depending on the data you collect you may be subject to certain laws and policies that prevent you from sharing your data such as patenting, HIPAA, FERPA, or Export Control. Please see our section on Data Policies for further information.