If a question is merely closed, that doesn't affect anyone's reputation. The OP, and those who posted answers, will keep any rep they gained or lost from up/downvotes.
If a question is deleted within 60 days of being asked (I think 60 days is the threshold), any rep changes related to that question will be undone. This includes rep gains/losses from up/downvotes, the rep bonus for an accepted answer, and the 1-rep cost for casting a downvote on an answer. However, if the question is deleted after more than 60 days, those rep changes are locked in and are not undone.
Votes on deleted posts remain on your public vote counts (AFAIK), and actions related to deleted posts still count towards your badges. For example, if you ask a question that initially gets an upvote, but is later heavily downvoted and deleted, you'll still keep the "Student" badge you earned for asking a question with a positive score.