There are no rules about what kind of chocolate to use. Cocoa powder is commonly used because it's easily available and usually has nothing but chocolate in it.
Read the ingredients of your chocolate. If it says it's pure cocoa, then you're all good. If it has any kinds of cocoa butter, fats, etc. added to it, then you'll want to avoid it. Anything with butter or fats in it will release oils into your beer that will kill the head on it.
As for when to use them...again, no rules. I usually add half of my chocolate in the last 5 minutes of the boil to avoid extracting too much bitterness from the chocolate. I add the other half to the secondary fermenter to add more aroma.