General Rule:
* Periods and commas ALWAYS go INSIDE the parentheses if the parenthetical phrase is a complete sentence.
* Periods and commas ALWAYS go OUTSIDE the parentheses if the parenthetical phrase is not a complete sentence.
Examples:
* Inside: "The cat (who was very grumpy) sat on the windowsill."
* Outside: "The cat sat on the windowsill (a grumpy one, at that)."
Other Punctuation:
* Question marks and exclamation points go INSIDE the parentheses if they belong to the parenthetical phrase.
* Question marks and exclamation points go OUTSIDE the parentheses if they belong to the main sentence.
Examples:
* Inside: "What did you do with the money (you promised you'd save it!)?"
* Outside: "Did you see the cat (it was huge!)?"
Exceptions:
* If the parentheses are used to enclose a citation, the punctuation goes outside the parentheses.
* If the parentheses are used to enclose a number, the punctuation may go inside or outside depending on the style guide.
In Summary:
The best way to ensure you're punctuating correctly is to consider the parenthetical phrase's role within the sentence and apply the general rules accordingly. If in doubt, consult a style guide or a grammar expert.