Broadly the reference (or "referent") of a proper name is the object it means or indicates. The sense of a proper name is whatever meaning it has, when there is no object to be indicated. Frege justifies the distinction in a number of ways.
1. Sense is something possessed by an name, whether or not it has a reference. For example the name "Odysseus" is intelligible, and therefore has a sense, even though there is no individual object (its reference) to which the name corresponds.
2. Sense is wholly semantic. Reference by contrast, though semantic, is intimately (and puzzingly) connected with the named object. Mont Blanc is the referent of the name "Mont Blanc". But Frege argues that Mont Blanc "with its snowfields" cannot be a component of the thought that Mont Blanc is more than 4,000 metres high (letter to Russell). But if we find the same expression in two sentences, e.g. "Mont Blanc", then we also we recognise something common to the corresponding thoughts, something corresponding to the name "Mont Blanc". This common element, which cannot be the referent, must be the meaning or "sense".
3. The sense of different names is different, even when their reference is the same. Frege argues, in what is probably his most famous philosophical essay, that if an identity statement ("Hesperus is the same planet as Phosophorus") is to be informative, the proper names flanking the identity sign must have a different meaning or sense. But clearly, if the statement is true, they must have the same reference.
The idea has given rise to much famous disputation. Gareth Evans, for example, has argued that Frege held a Russellian theory of names, according to which there are no thoughts corresponding to empty names. His argument faces the difficulty that Frege did indeed hold we can express a thought using the name "Odysseus".
The distinction is commonly confused with that between connotation and denotation. (A distinction which predates Frege, famously interpreted by Mill). The "connotation" of a concept-word like "planet" is the concept that the concept-word refers to. Denotation is any object (such as Venus or Mars) which, in Frege's terminology, falls under or satisfies the concept.