The amount of hops to use is largely a matter of preference. Between 1 and 2 oz (28-55g) per 5 gallons (19 L) is considered a moderate amount. Less can certainly be used if you are shooting for a mild floral aromatic, and true hopheads use as much as 4 oz of hops for 5 gallons for a burst of aroma.
When should one add hops to the beer, and for how long? Some brewers add dry hops during primary fermentation, but most agree this can result in loss of precious hop aromas due to the steady stream of CO2 bubbling out of the fermenter.
The appropriate time to add dry hops is after primary fermentation has completed. Adding dry hops to the secondary maximizes the exposure without risking volatile aromas. A third option is to add dry hops directly to the keg, but this can result in some grassy flavors from overexposure as the hops may remain in the keg for months.
Some brewers use a mesh bag to make it easier to contain the hops and make them easier to separate from the beer later. Others merely separate the beer from hops carefully when siphoning later. Pellets tend to sink after a while, while whole hops and plugs tend to float. Obviously a bag is required for kegging your hops to keep the hops from plugging the keg.