Basically, a tragedy is a piece of literature in which the main character is overcome by some type of catastrophe. In ancient literary works, the tragic character was usually someone important, such as royalty or type of hero, who possessed a weakness, or flaw, that led to his or her ruin. More modern tragedies often include main characters that are "normal" people who are overcome by a problem with society. The idea of tragedy usually causes the audience, or reader, to sympathize with the main character and feel pity for him; at the same time, the audience usually considers the hero to be a sort of noble character.
In Romeo and Juliet, the two main characters meet tragic ends due to their shared character flaw, impulsiveness. Their willingness to do anything for one another, as well, as their powerlessness to act against the society in which they live, invokes pity in the audience. In the end, both Romo and Juliet kill themselves, although simple precautions and rationale could easily have saved their lives, as well as the lives of others (Paris, Benvolio, Lady Montague, etc.).