Should I always provide my current affilition and address when a paper got accepted?
This comes up a lot when professors visit other universities, actually. In mathematics it is common to use footnotes on the front page to cover grants and visits. So in the author list you might have
John Q. Public1
University of Wheresistan
with a footnote saying
1This author was partially supported by NSF grant 12345. Research was conducted while visiting the University of Whatsitville.
The exact formatting and content is something that will ultimately be determined by the journal in question, and your particular circumstances. The note may also include a thank you to the hosting university, or it may be split up (one footnote for the funding, another for the hosting/thanks). You can probably find several examples like this just by surveying (the first page of) current research articles.
So I'd suggest using an author footnote on the first page that includes the pertinent information. Use your current contact information and use the footnote to briefly mention the role played by other institutions and grants. You can consult the journal's style guide--and if you're still unsure, ask an editor--to see if they have any specific requests or instructions for this sort of entry. I believe most journals are fairly generous in what they allow here, and leave it up to you to make sure the proper thanks are given.
I think you should include both. Institute A should get the recognition that you produced the work while there and you should also add "current address Institute B" if readers want to contact you.
Give the affiliation(s) where the research was conducted (universities and departments get credit in Scopus/ISI/Google Scholar for publications too and it affects their ranking) and put a footnote as to your current address if needed - just make sure it is clear which university supported you during the time when the work was done. I would make the case that your revisions at University B deserves a mention (even if through co-authors, revision is work after all, sometimes more than the original paper), maybe by giving both affiliations.
This is probably only really important for the corresponding author, but make sure to follow the rules of the journal you submit to and follow the standard practice in your field. But from my experience, they usually don't specify or care. It is common (I am actually dealing with this now on a paper I am preparing for submission) to use old affiliations when students are authors on papers and who have graduated since the work was done.