A melee (also mêlée) attack is a close proximity hand-to-hand attack, as distinguished from a ranged attack. Moving into a monster initiates a melee attack against it, either with a wielded weapon (or other item), or your bare hands, if you don't wield anything. You can use the Shift-F command to force your next input to be interpreted as a melee attack. (Pounding is not considered a melee attack.)
You are only vulnerable to a monster's melee attack if you are adjacent to it. Almost all special attacks count as melee (e.g. stealing or cursing items, but not summoning monsters).
See the ranged attack page for strategy about when you may want to use ranged attacks instead of melee, sometimes even when you are in melee range.