A user's "karma" reflects how much a user has contributed to the reddit community. When posts or comments get upvoted, that user gains some karma. You can see how much karma a user has on their profile page.
The best way to gain karma is to submit posts that other people find valuable and interesting. Also comment. Being on-topic, relevant, funny, interesting, or engaging are great ways to earn comment karma. Being insulting, rude, or abusive is not. Snark can go either way.
Don't set out to accumulate karma; just set out to be a good person, and let your karma simply be a reminder of your legacy. Note: reddit makes no guarantees about attaining Nirvana.