Irony is defined in Enotes' Guide to Literary Terms as "a figure of speech in which the literal meaning...is the opposite of that intended". More specifically, situational irony is when the irony stems from the situation of the story or poem itself. An example of situational irony might be when a pickpocket gets his own pocket picked.
In "Richard Cory", the poet, E.A. Robinson, describes Mr. Cory's life in consistently positive terms. Richard Cory is a gentleman, he is rich, people are in awe of him. His state of life, or situation, as set forth by the writer is eminently desireable; he has achieved a high level of material status and comfort, things for which most everyone aspires. Our society leads people to believe that if they can only attain these things, they will be happy. Richard Cory has done that, he must be very happy, people want to be like him.
The irony of Richard Cory's situation is that, despite all indications to the contrary, he is not happy at all. In fact, he is so unhappy, he kills himself.
Robinson, in this poem, uses situational irony to get his message across. Taken in literal terms, Richard Cory has a great life, but in reality, it is empty, not wonderful in the least.