What counts as statistics for monsters is defined in the Monster Manual introduction in the section "Statistics". It begins by saying:
A monster's statistics, sometimes referred to as its stat block, provide the essential information that you need to run the monster. (MM 6)
We have here a general rule that is easy to apply: if it is in a stat block then it is considered part of that creature's statistics.
The book describes each aspect of the statistics in a short sub-section (MM 6-11).
- Armor Class
- Hit Points
- Ability Scores
- Saving Throws
- Vulnerabilities, Resistances, and Immunities
- Special Traits
- Limited Usage
Class and class features are part of statistics too (including feats)
Monsters, by default, are not given class levels and thus no section was dedicated to talking about them as part of the statistics. However, a later section talks about the option of adding class levels to monsters:
You can use the rules in chapter 3 of the Player’s Handbook to give
class levels to a monster. For example, you can turn an ordinary
werewolf into a werewolf with four levels of the barbarian class (such
a monster would be expressed as “Werewolf, 4th-level barbarian”).
Start with the monster’s stat block. The monster gains all the class
features for every class level you add, with the following exceptions:
- The monster doesn’t gain the starting equipment of the added class.
- For each class level you add, the monster gains one Hit Die of its
normal type (based on its size), ignoring the class’s Hit Die
- The monster’s proficiency bonus is based on its challenge rating, not
its class levels.
Since class levels and class features are also added to a monster's stat block, and the terms "statistics" and "stat block" are defined to be interchangeable (per the first quote in this answer), monster class levels and all the features thereof count as part of a monster's statistics.
Feats appear to be generally given by a class:
At certain levels, your class gives you the Ability Score Improvement feature. Using the optional feats rule, you can forgo taking that feature to take a feat of your choice instead.
Thus, as a class feature, Feats are also considered to be part of a monster's statistics.
Legendary Creatures have Legendary Actions as part of their statistics
When a creature is a legendary creature it sometimes has special actions called Legendary Actions inserted into their stat block. These (as with everything else in the stat block) are considered part of the creature's statistics.
Note that some legendary creatures also have lair actions and regional effects. However, these appear outside the stat block and the Monster Manual makes it clear that not every legendary creature with those listed even has access to them. So these would not be considered as part of that monster's statistics.
An NPC's stats can be generated in several different ways as defined in the DMG section called "NPC Statistics":
When you give an NPC game statistics, you have three main options:
giving the NPC only the few statistics it needs, give the NPC a
monster stat block, or give the NPC a class and levels. The latter two
options require a bit of explanation.
Using a Monster Stat Block
The Monster Manual contains statistics for many generic NPCs that you
can customize as you see fit, and chapter 9 of these rules offers
guidelines on adjusting their statistics and creating a new stat
Using Classes and Levels
You can create an NPC just as you would a player character, using the
rules in the Player’s Handbook. You can even use a character sheet to
keep track of the NPC’s vital information.
Class Options. In addition to the class options in the Player’s
Handbook, two additional class options are available for evil player
characters and NPCs: the Death domain for clerics and the oathbreaker
for paladins. Both options are detailed at the end of this chapter.
Equipment. Most NPCs don’t need an exhaustive list of equipment. An
enemy meant to be faced in combat requires weapons and armor, plus any
treasure the NPC carries (including magic items that might be used
against the adventurers).
Challenge Rating. An NPC built for combat needs a challenge rating.
Use the rules in chapter 9 to determine the NPC’s challenge rating,
just as you would for a monster you designed.
It is clear that what counts as statistics for an NPC are the same as what counts for monsters and PCs. However, the DM, for simplicity's sake, has a lot of leeway on how many of those statistics they need to define when making an NPC. Of note is that NPC class levels and equipment are also considered part of their statistics.
The statistics for a PC include all of the same things as for monsters and NPCs. The description of building an NPC like a PC (above) confirms that creatures built this way count those things as statistics and really that just makes sense.
Basically, anything on the standard PC character sheet is considered to be a statistic.