Publishers may stipulate that upon publication the data on which your article is based are made available to others for reference.
A number of journals have a separate Data Availability or Data Archiving Policy (DAP). The requirements are generally found on the journal's website.
In general there are three scenarios:
The exact requirements to be satisfied are usually listed in the instructions for authors on the journal's website or that of the publisher.