Q: How many people work on TF2 and what do they do for the game?
A:The number of people working on TF2 changes daily. It can be as low as 2 people or up to 15 people. The concept of "TF Team" (or even Dota team, CS:GO team, ...) is actually a confusing misnomer.
Valve as a company has about 340 employees with diverse talents. Their employees consist of artists, level designers (e.g. map makers), systems programmers, animators, database administrators, hardware specialists, and so on. Valve doesn't section off their 340 employees into groups like "these 20 work on TF2" or "these 30 work in CS:GO." Instead, people move from project to project based on the project's needs and importance to the company as a whole.
There are rooms in the office designated for each project (though they can obviously change based on which projects become more important). For example, there's a TF2 room, Dota room, CS:GO room, steam room, and so on. When a project needs more people working on it, the necessary people will wheel their desks over to its room. (Disclaimer: I have not seen how many desks are in the TF2 room.)
Someone from the TF Team went to the CS:GO room to fix an issue with their linux buildbots crashing. (A buildbot is a complex program that compiles all their source code into binaries.)This Valve employee wheeled their desk from theTF2 room over to the CS:GO room to solve the problem. Why did a TF Team member go fix a CS:GO issue? Said employee is a genius linux guy and the CS:GO team needed a linux pro, so this employee moved from TF2 to CS:GO to fix their linux issues, then moved back to TF2.
When Valve was building the Jungle Inferno update, the artwork was made largely by the CS:GO team. The same reason above applies; the TF Team needed artists to draw the graphics for Jungle Inferno (such as the main menu graphics) and the CS:GO team had a few artists, so the TF Team went to the CS:GO room to ask people to help them with the Jungle update, and said artists wheeled their desks over to the TF2 room. Once the artwork was completed, those artists wheeled their desks back to the CS:GO room(or wheeled to another room working on a project that needed artists).
As demonstrated above, Valve is a flat hierarchy company and does not have managers. However, this does not mean that employees are free to work on whatever they want.Employees don't have as much freedom to choose their projects as outsiders seem to think they do. Rather, because nobody is a manager, everybody is a manager (the opposite of "if everyone is super, nobody is super").
When CS:GO needed a linux guy, they assumed the manager position and got someone from the TF Team to work for them. Similarly, when the TF Team needs artists, they put on their manager cap and went to the CS:GO room to get people to help finish their project.
To come back to this question again, the question is flawed because it doesn't fit with how Valve works as a company. People come and go from projects all the time based on company needs and priority. At one point the TF2room may have had 15-20 employees (such as when they were making MvM in 2012). I don't know how many people are in the TF2 room right now, but that number is useless considering it could very well change (for better or for worse) the next day or week or month.