Wikipedia gives info on origin and context of both terms:
Nerf (computer gaming):
In video gaming a nerf is a change to
a game that reduces the desirability
or effectiveness of a particular game
element. The term is also used as a
verb for the act of making such a
change.The opposite of nerf is buff
(in one of that term's two usages).
The term originated with Ultima
Online, and refers to the Nerf brand
of toys which are soft and less likely
to cause serious injury.It is used in
the context of virtual worlds such as
MMORPGs (like UO) and MUDs, but has
become a part of the general
vocabulary of gamer slang and can be
found in various places where
adjustment of power levels from one
version of a game to the next is
relevant.
Buff (computer gaming):
Buff is a term used in some video
games, especially MMORPGs and MUDs, to
describe increases in the power of a
game element. There are two main
usages. The first describes a
permanent (or at least indefinite)
increase in power levels as a result
of adjustments to game mechanics,
usually in pursuit of game balance. In
this usage, buff is the opposite of
nerf. The second usage of buff
describes an effect (usually cast as a
spell) that temporarily enhances a
player.
You can read the linked articles for more.
Online Etymology Dictionary has an entry for buff as well:
1570s, buffe leather, from M.Fr. buffle "buffalo" (15c., via It. from L. bufalus; see buffalo). The color term comes from the hue of buffalo hides (later ox hides); association of "hide" and "skin" led c.1600 to in the buff, and use of buff or suede to polish metal led to sense of verb "to polish with a buff" (1885). Related: Buffed;
buffing. Buff-colored uniforms of N.Y.C. volunteer firefighters since 1820s led to
meaning "enthusiast" (1903).
The Buffs are men and boys whose love of fires, fire-fighting and firemen is a
predominant characteristic. [N.Y. "Sun," Feb. 4, 1903]
Adj. meaning "well-built, hunky" is from 1980s, from sense "polish, make attractive."