Although the characters in Tartuffe mention Heaven quite a lot, seeming to use the word in reference to not just "God" but also "fate" and, of course, a literal afterlife, perhaps the most memorable instance of their discussions of Heaven is the one you mentioned. It's a line spoken by Tartuffe himself, the title character, in Act 4, Scene 5. Here's the entire statement:
Tartuffe: "Some joys, it's true, are wrong in Heaven's eyes; / Yet Heaven's not averse to compromise; / There is a science, lately formulated, / Whereby one's conscience may be liberated, / And any wrongful act you care to mention / May be redeemed by purity of intention."
Depending on which translation of the play you read, your English version might look more like this:
"I know the art of pacifying scruples / Heaven forbids, 'tis true, some satisfactions; / But we find means to make things right with Heaven. / There is a science, madam, that instructs us / How to enlarge the limits of our conscience / According to our various occasions, / And rectify the evil of the deed / According to our purity of motive."
Regardless of how the message is translated into English, it's the character Tartuffe himself who's saying this. He's basically asserting, much to the frustration of many religious readers, that it's okay to do whatever you want in life (to sin however you please) as long as you repent for it, and you can still get into Heaven. In other words, Heaven is okay with "compromising," according to Tartuffe, letting people in who have sinned because they apologized afterward or made recompense for it.
You can tell that this is something Tartuffe would say, because he's such a hypocrite: he acts as if he had no morals, yet he claims to be a pious man. He chases after a married woman, yet he thinks of himself as having upstanding Christian values. In this little speech, he appears to be justifying all of his wrongs, implying that despite all of his sins, like his attempted seduction of that married woman, he is still following the rules of his religion and that he'll still be admitted to Heaven after his death.