Provided that the poem 'When I have Fears' have fourteen lines, and follows the Iambic Pentameter, it is a SONNET.
Moreover, its rhyme scheme of a-b-a-b-c-d-c-d...etc. and that the poem ends with a rhyming couplet determines that it is a Shakespearean sonnet.