The main purpose of hyphens is to put words together. They tell the reader that two or more words are related. As with any other punctuation mark, there are rules which establish when to use hyphens correctly.
One of these rules sets that you should hyphenate all compound numbers from twenty-one through ninety-nine. Therefore, the sentence that uses a hyphen correctly in the examples is B: I need thirty-six colors for this painting.