Forum links are useful for indirectly improving SEO and ranking, by boosting the organic direct traffic of one's site. Most of the comments here dwell on the direct SEO aspects too much, especially considering that many or most forum links now are either n0 follow, or don't permit hyperlinks for topically relevant discussions. That means, in those cases, even a relevant/contextual comment will not impact ranking directly. It also means SEO based ranking will have to concentrate on sites 1) that allow d0 follow linking, and 2) have high link strength based on DR/DA/AS or TF metrics to establish topical authority.
The most efficient way to work forums is to focus on dual use of them to grow overall traffic, whether one is trying to build search engine traffic from ranking, or referral clicks for organic traffic (straight to the domain, without third party search engines). Ironically, direct-to-domain traffic will be interpreted by Google as a sign of greater organic sign of topical authority, so will indirectly improve rankings. A good "sweet spot" to proceed from is a medium of around 1800-2000 minimum in monthly search volume.
From that baseline, try to add the d0 follow links to your direct ranking efforts, while making as much as ten times as many links (at that msv) with links of the n0 follow variety. So long as they are low/moderate comp, and are used on relevant forum topics, make DF and NF links for the same terms, at the same time, in that 1:10 pattern. This ratio should roughly double one's overall traffic results, without doubling the labor. Since the n0 follow links don't impact direct ranking or for indexing, they would be excellent for referral linking, branding or even some blackhat blitz campaigns.