The calculator above will give you precise amounts for various beer styles, but it's also something you can play with. More sugar will equal more carbonation, so you have a little bit of creative control. For example, do you want a particularly bubbly stout? Or a lightly carbonated pale? Generally, your range is going to be between 3-5oz of sugar per 5 gallons of beer...but you can get more or less, to your taste.
The above process advice is solid...I'll add that if you forget to put it in the bottling bucket before racking (don't), stir very, very gently with a well sanitized instrument. Move quickly, so as not to expose the beer, but be very gentle.