The answer to your question about how long it takes to publish a paper, this depends on the subject of the paper, the journal, the editor, and the reviewer.
It depends on the publication timelines of the journal as some publish bi-monthly monthly, quarterly and annually. Many journals after acceptance of manuscript, put it online (They have the online first system).
The publication of manuscript depends on journal, publisher, editorial board and frequency of journal. Some of the journal normally takes few weeks to 12 months to published.
It depends on the publication timeline of the journal and also your article quality. You can check it by opening most recent articles of the journal that you want to publish in it and see the received date, accepted date and the publication date.
In my opinion, it all depends on the nature/content of your study (review paper/research paper), reviewers and editorial board of the journal. The time period may vary from few months to more than a year.
A high quality research paper intended to be published in a prestigious journal may take quite some time ( about a year or so, to be exact). The reason is that the journal benefits from the services of referees that are the avant guards of the field and they evaluate the papers meticulously by listing various instances of revision whose treatment by the author may take a considerable amount of time.
In my experience, it varies with different journals and their editors. Some journals receive a lot of quality papers and sometimes one's paper has to wait because the yearly issues are already full. Also come editors and their journal managers are more efficient than others. Still others have more resources for efficient production than others. I have had experiences that range from eight months to two years.