Yes, you can be sued for libel for something you write on a forum.
If you write something defamatory about a person who is recognizable and identifiable, the person you defamed can file a suit against you. If you are "anonymous" online, the person will file a "John Doe" lawsuit and the court will order the website to reveal your real identity so that the lawsuit can proceed against you. You will generally be notified about the court order prior to your identity being revealed, so that you have an opportunity to respond to the lawsuit before your identity is revealed.
There is, quite frankly, no real anonymity on the Internet, so you must be careful what you write.
If what you wrote is true, that would be a legitimate defense to any libel action brought against you, but it does not prevent a lawsuit from being filed in the first place. You would use "truth" as your defense in court - and to use truth as your defense, you would have to prove that what you wrote was, in fact, true, or was reasonably believed by you to be true.
Truth will NOT protect you against an invasion of privacy action, however, if you reveal information about someone that is true but confidential or true but potentially embarassing for the individual.
The "punishment" for libel varies.
For any defamation action, the individual defamed would have to demonstrate reputational injury suffered as a result of the comments made. Because reputations do not come with a price tag, an individual defamed will ask for a LOT of money to compensate for his injury. Money awarded for injury to a reputation is called compensatory or general damages. Pecuniary damages can also be awarded - these are actual monetary losses suffered as a result of the defamation, occurring from the loss of a job or the loss of a promotion, for instance. Additional damages can be awarded for pain and suffering, although this is not common.
Defamation suits are expensive to bring - and even more expensive to lose. It is certainly better to never to say anything defamatory about anyone ever.