What do T2, T3, T4, and T5 stand for? Does it mean the number of rooms?
The number counts the rooms where one can live: bedrooms and the (aptly named) living room; 'T' stands for 'type'. You can also find 'F' instead of 'T', there is no difference.
Rooms "for living" must fill some criteria to qualify as such: minimum area (I believe 9m²), a minimum height and a at least one window. If the room has no window (dark or open), or is too small, it doesn't count, and can only be advertised as a storage space (often called "cellier" or "loggia"). Also mandatory are a separate bathroom, and kitchen and toilets, both of which may or may not be separate from, respectively, a regular room and the bathroom.
You might in very rare cases also get a large "dark room" ("pièce aveugle"), without window, suitable to be used as a study/computer room, but which can only be advertised as a storage space. So a T1 might give you 4 rooms in total (bedroom, kitchen, bathroom, "storage space"). (I actually had a 60m² T2 with a similar arrangement--very comfy.)
Also, some "wide" living rooms (>20m²) will be advertised as two rooms. So a T3 might only get you 3 rooms (large living room with kitchen, bathroom, bedroom).
Note that a 'T1' and a 'studio' are not the same thing:
TI : one kitchen, one bathroom, one room;
Studio: one bathroom, kitchen and bedroom in the same space ("cuisine américaine").
Yes it does.
To be more specific, this is the number of rooms in which you can live: the kitchen, the bathroom, the toilets are not included in that number, but only the rooms and the living and dining room(s). A "dressing" doesn't count either unless it meets the requirement of a "main room", according to this article.
This number should also include at least one room. For example you cannot have just a living room and a bathroom as a room is mandatory.