The terminology is a little tricky because there's blurring between the definitions.
A synthesizer is basically anything that generates sound by synthetic means, which boils down to some way of taking electrical signals and manipulating them electronically to get waveforms that can then be turned into audible sound. The intent is to be able to both mimic natural sounds and create entirely new sounds
There are many ways of doing this -- the source of the signal can be one or more things, and the means of manipulating the source too... You'll see references to additive synthesis, subtractive synthesis, FM synthesis... and wavetable synthesis.
A sampler is basically a device that can record sounds, manipulate them, and play them back. It typically allows all kinds of control over the recorded sound. In fact, technically this sort of sampling is merely a particular form of synthesis -- where the source of the original waveform is a recording of something in the real world.
The most significant difference between something you would call a sampler and something you would call a synthesizer is the device's capability to let you actually record the source sound yourself. But in a software environment the blurring becomes greater, because you can use the computer to do everything -- record the sound, manipulate it with incredible control, save it in a wavetable format for a wavetable synth or in a sample format for a sampler, not to mention recording it in the more traditional, tape-recorder like manner into a recording application, mixing it with other stuff, and playing it back...