It is the total number of personal fouls commited by the members of the team. I can't tell you what the current rules are, but in the past Team Fouls were accumulated each half and upon exceeding a certain number (i.e. 7) the other team would be awarded bonus free throws of some kind (i.e 3 chances to make 2). You will hear them as the half closes talking about some team having "fouls to give." That means that they are approaching but not yet exceeded the team foul limit where a penalty is imposed.
Technicals or any offensive fouls do not count. Loose ball fouls do. The rule is that the fifth team foul of the quarter gives the other team freethrows, whether they were in the motion of shooting or not. Also, if not many fouls were committed in the first 10 minutes of the quarter, then 2 fouls in the last 2 minutes also puts the team into the penalty. This basically prevents teams from saving up their team fouls and fouling 4 times at the end of the quarter.
KeepKenny pretty much summed it up perfectly. But it only applies to NBA basketball. College and international ball have different rules.