Reputation points are earned by asking or answering questions. When you do that, those posts can be voted upon by other users. When somebody votes for your answers or awards you a bountty, you gain some, and when somebody votes against them you or you vote against an answer (but not a question) you lose some. A vote for a question gets you five; a vote for an answer gets you ten; a vote against one of your posts loses you two and a voting against an answer costs 1. Less often you might get your answer accepted by the questioner which gives you 15, or win a bounty from another user, at their cost, which can be awarded in increments of 50 up to a limit of 500.
Commenting is a privilege that you have to earn because we are focused on questions and answers, so we do not just want people commenting willy nilly. We want people to have some familiarity with the website so they know how to comment. You can read the full commentary guidelines here. The major ones are no answering in the comments (which is important, but often ignored), and to focus your comments primarily towards leaving constructive criticism, or leaving behind transient information which may be deleted later like relevant links to related resources.
Also you might do well to read as much of the help center as you can prior to contributing because we have many similar expectations which can catch users off-guard.