Data Values
Data values (often shortened to DV) is a numeric system to differentiate between different states or textures. This system has since been superseded (or are in the process of being replaced) with separate resource locations (The Flattening) and the use of block states and nbt or item components in most areas of the game post the World of Color Update. In the versions where data values are used, multiple pieces of information is often packed into the values by using bit packing or bit fields.
Blocks
As mentioned data values typically make use of bit fields, this holds true for multiple types of blocks that need to hold multiple types of state. Typically blocks are limited to 16 states (0-15) meaning the data value of a block can be represented with 4 bits. An example of a block that utilizes bit fields is the stone slab. The first three least significant bits determine the material of the stone slab i.e. 3 for cobblestone and 4 for bricks. The most significant bit determines if the stone slab is an upper slab or not, 0 means it's a lower slab and 8 means it's an upper slab. Combining the two states yields 3 for a lower cobblestone slab and 11 for an upper cobblestone slab.
Items
In contrast to blocks items can have data values ranging from 0-32767 due to items repurposing the damage tag that tools use to keep track of used up durability points. As a side effect of utilizing the damage tag items with a data value in early versions of the game often rendered with a durability bar. The information encoded by the data value of items could vary drastically between items and versions, bit fields, most specifically for the item form of many blocks as well as being a secondary form of NBT storage.
Entities
Data values are mostly used on entities for textures and are stored in various places in NBT. Some entities such as horses make use of bit fields to store combined information, in the case of the horse it stores the base color/texture and the markings that are applied.
Invalid Data Values
Considering the nature of how data values store information simply as a number multiple glitches have allowed data values to be misapplied to blocks and items, sometimes causing data values that weren't intended to be applied to the block or item. These occurrences are often refereed to as "Invalid Data Values" and may cause odd behavior to how the block or item renders and interacts to different situations, sometimes even causing a crash or other harmful effects.