First, you must decide why you want a digital piano. If you know of the term digital piano, you've probably already decided that you want one because it more closely emulates the sound and feel of a real piano. The digital piano you should buy depends on your current skill level, goals, and budget. They can range from ~400 to 20,000 dollars, and the quality increases with price, though with diminishing returns. Let's get into the features you should look for:
Weighted Keys
The major difference between a digital piano and a keyboard is that the former have weighted keys. This means that inside the piano there are counterweights on the backs of all the keys that force the key upwards and make it harder to push down. This emulates the hammers attached to the keys of a piano. The best digital pianos have realistic "hammer action" that closely resemble the feeling of playing a grand piano. Another thing to look for is something called graded action. This means that keys at the bottom of the piano feel heavier than keys in the middle, and keys at the top feel lighter. This is another feature that makes digital pianos feel like acoustics. If you are buying a digital piano because you want something that approximates an acoustic, then you absolutely need these features. Be warned, the key action of every piano is different, and some are better than others. Make sure you read reviews or test a digital piano before you buy it. Some low-end digital pianos will advertise that they are "velocity sensitive," or "velocity graded." This means that if you hit a note harder it will play louder. This is not the same as having weighted keys, and it comes standard in all digital pianos.
Sampled Sounds
In order to sound like the real thing, digital pianos use sound recorded from an actual grand piano. This isn't as simple as it sounds because there is a lot of technology that goes into transforming that recording into something that sounds realistic on your keyboard. If you play one note on a real piano at different sound levels, the note doesn't just get louder and quieter; the sound itself actually changes. The louder you play a note, the harsher and less smooth it sounds. This is a change in timbre, which refers to the quality of a sound, or technically, the combination of many different frequencies to produce an audio pattern. It's the same thing that makes each person's voice sound unique. To capture this effect, digital piano makers sample the sound at several different levels. They then use software to blend these samples into a continuum of changing sound. When looking for a piano, more samples are better, and some s have special technology that makes the sound more realistic in other ways. Again, every piano will sound different, and some sound more realistic than others.
Polyphony
This is how many notes can be played at once. This is especially important if you're playing something in which you hold down the sustain pedal while playing many notes; they'll quickly add up. A good number to have is 64 or 128, but you only need 128 if you're going to be playing some classical music with very fast passages while sustaining notes.
How many keys?
Digital pianos typically come in 61, 76, or 88 keys. Obviously, you have less notes and range to play around in if you don't opt for the full 88, but those pianos will let you transpose the notes up or down an octave. You don't really need the full 88 except for a relatively few number of classical pieces. Personally, I don't like to be limited if I can avoid it, so I'd never get a piano with less than 88 keys.
Speakers
Different digital pianos come speakers of varying power and quality. Some, both cheap and expensive, don't come with speakers at all. Make sure you know whether or not the piano you buy has speakers and that they will be powerful enough for your needs. Keep in mind that you can always output the sound to better speakers in the future.
Instruments and Effects
There is a lot of variation in the digital piano market here. They all have different amounts of instruments (or voices) and rhythm tracks. The quality of these voices varies greatly, so if this is a factor in your purchase, you need to try them out yourself. There is also an array of effects that can come with a digital piano. Some let you mix and match voices, record, and store songs and settings.
Tuning Capabilities
Some pianos have the ability to change tuning, temperament (frequency distance between each note), and can transpose to different keys. These are very useful for playing in bands or with other people.
Connectivity
All digital pianos come with different audio jacks. Most have two stereo outs, two stereo ins, and a MIDI out and in. Some have USB and SD card connectivity.
Conclusion
Now you are acquainted with all of the features common to digital pianos. If you are a beginner or intermediate-level pianist, I'd recommend an entry-level piano such as the Yamaha P-95 or Casio PX-330. These pianos cost about 0, but they are very good for the price. The sound will satisfy all but the most advanced of ears, and the key action is much better than lower priced pianos. I prefer the PX-330 because it has far more voices and rhythms than the P95, along with more features for playing on stage or in a band.