This quote is taken from Act II, Scene VI, in which Romeo and Juliet are secretly married by Friar Lawrence. In the first line of this quote, Friar Lawrence expresses his wish that God ("the heavens") is happy with this marriage. In other words, he hopes that Romeo and Juliet's union has divine approval.
It is important that this marriage is blessed by God since Friar Lawrence is worried that if it is not, something terrible ("sorrow") might happen in the future ("after-hours").
This line, therefore, serves as a reminder to the audience that Romeo and Juliet's relationship is fated to fail. Some terrible things do happen later on. In the next Act, for example, Romeo kills Tybalt and is banished from the city. Moreover, Lord Capulet arranges Juliet's marriage to Count Paris.
Friar Lawrence's comments, therefore, foreshadow these events. Moreover, they suggest that Romeo and Juliet's marriage does not have divine support, and as a result, the couple is prevented from making their marriage public and ending the feud between the Montagues and Capulets.
Friar Laurence’s statement seems to indicate both hope and fear. He considers Romeo and Juliet's marriage to be “holy,” both as a marriage and as an act of reconciliation. The two lovers can consummate their relationship in the church-approved sanctity of marriage, and their love can unite their warring families. However, the friar is aware that “afterhours” sorrow will chide, that bad things could follow.
Romeo does not think that far into the future. He is only concerned with his overwhelming passion for Juliet:
… come what sorrow can,
It cannot countervail the exchange of joy
That one short minute gives me in her sight:
He does not care if even death consumes them as long as he has this brief pleasure.
Friar Laurence urges temperance, famously declaring, “These violent delights have violent ends / And in their triumph die, like fire and powder.” It is the rashness of this wedding in such a divided society that gives the friar concern. Unfortunately, sorrow does “chide” those involved. A long list of people die: Mercutio, Tybalt, Paris, Lady Montague, Romeo, and Juliet. The only good that arises from the union is a significant if difficult lesson, because the Montagues and Capulets finally make peace.
Friar Laurence is blessing the marriage of Romeo and Juliet ("So smile the heavens upon this holy act"), and he hopes that nothing will bring them down or disapprove of their marriage ("That after-hours with sorrow chide us not!").