Can I add an author after the journal accepted my article but has not yet published it? I’m considering to add a friend later, but I am not sure about it now.
Essentially, no, you can't reasonably add an author to an accepted paper to your manuscript after it's been accepted. Doing so generally implies, as several commenters have already suggested, that you neglected to acknowledge someone's vital contribution to the paper (which is unethical), the person didn't want to be acknowledged for some reason (very rare), or you've done something else unethical to add the author (a "quid pro quo"-like arrangement?).
The only way it would be really acceptable to add an author is if you realize there is a significant problem in the manuscript which you correct or modify with the help of the new author. Note that this means further review is probably required.
You got yourself into an awkward spot:
If the friend of yours did significant work on the paper, then she should have been an author of the paper all along. By omitting the friend's name from the list of authors, you were academically dishonest.
If the friend of yours did not do significant work on the paper, then she should not be an author. If you add her as an author, you are being academically dishonest.
The first of these is a situation you can rectify by adding her before publication. The second situation will be with you forever if you do something unethical. Either way, a good editor will want to hear a good explanation for how you got yourself into this situation.
It's journal dependent, and for a respectable journal, you would probably need to present a good case for it.
In any case: Ask the editor! And chances will only be worse the longer you wait.