Some journals are public access. Some journals make articles publicly available after some time period, for example a year. Others are complete paywalls.
There is a distinction between the document you submit and the edited document which is published; your freedom to distribute the edited document may be more limited, although you will typically be able to share on an individual basis with colleagues.
Also there is arxiv. I would bet that you would be allowed to keep your preprint on arxiv as long as it is untouched by an editor of a journal, but I'm not positive about this and I would like to know more myself.