It's up to the DM to decide, but you're asking for trouble if it does come with languages.
I'm going to answer my own question here, because I spent all night thinking about it and I don't think it's right to expect this much detail from anybody else.
I don't think this actually can be resolved with the rules as written. The other answers so far both say essentially the same thing: it's up to the GM. That said, I think there's a lot the GM would have to think about. Here I'm going to argue that the cleanest option is to rule that the headband's granted ranks do not allow a character to learn a new language. But I will also comment on what the GM will also have to rule if they rule otherwise.
Why Linguistics is Problematic
Languages are a separate system from skills. Many characters will never take a rank in linguistics, and simply speak languages based on their race and starting intelligence bonus.
Linguistics is an oddball skill in Pathfinder for two reasons. First, it is the only skill for which taking a rank in it grants an ability that can be used without a skill check. Second, and more importantly, linguistics is the only skill that comes with any kind of option or choice. When a character puts a rank in knowledge (local), they do not choose a different locale for each rank. When a character puts a rank in disable device, they do not choose a different kind of trap or lock to focus on. Linguistics is the only skill that involves a choice while gaining a rank (viz., choosing a language.)
Because linguistics is unique, there are really no other situations we can refer to when trying to come up with a ruling about how exactly the language-learning ability works. (The same applies to D&D 3.5's speak language skill, and so we can't look at 3.5 for guidance here. 3.5 sidestepped this whole problem because the headband of intellect didn't grant skill ranks; I see the wisdom in that design decision now!)
A Possible Rules-as-Written Argument
The rules-as-written debate centers around the wording of the linguistics skill: "whenever you put a rank into this skill, you learn to speak and read a new language."
There is a related debate with regard to familiars and the linguistics skill. Familiars use their master's ranks in place of their own, and so many players have wondered whether a familiar who gains its master's ranks in linguistics also gets to speak, understand, read, and write the languages its master chooses. (Or better yet, whether the familiar can choose different languages than its master chose.) Of course, most familiars probably cannot speak or write those languages because of anatomical issues.
The rules-as-written debate centers around the language of "put a rank into this skill." Some players have argued that familiars simply have ranks, which is distinct from putting ranks into that skill. See, for example, this thread on Paizo's forums. Any effect that simply replaces your own ranks, it is argued, is functionally different from putting ranks into the skill, and you do not get any added bonus that comes from putting ranks into it.
At the same time, I have seen this masterwork of rules-lawyer-ing that argues differently. The writer points out that there is one place in the rules that uses similar language to the linguistics rules: class skills. The rules read, "You gain a +3 bonus on all class skills that you put ranks into." It is widely assumed that familiar get class skill bonuses for skills it "borrows" from its master; therefore, if we apply the same interpretation to both usages of the verb "to put", it would imply that familiars should also learn languages based on linguistics.
I think that most people assume class skill bonuses apply to a headband's granted skills, and so therefore by the same argument, if linguistics is granted by the headband, you also get languages.
I think that latter argument is actually pretty strong from a pure rules-as-written standpoint. That said, I also believe that these debates bring us far past whatever the game designers may have intended; I doubt that the designers ever consciously thought about "put a rank" having a very technical meaning that they consciously considered both when writing the linguistics rules and when writing the class skills section. And so, even if the latter argument is stronger, I don't think any rules-as-written argument is going to be really satisfying here, and it should be just one factor weighing against others.
Assuming you do get the languages... and they're "stored" in the headband
So, let's assume you rule that a headband of vast intelligence that contains linguistics skill ranks grants the wearer languages. What then?
Immediately, you are faced with the problem of how to determine those languages. There are two approaches: either the creator chooses those languages associated with the skill ranks, or the player chooses those languages. Both of these approaches lead to counterintuitive results.
Intuitively, it feels like the choice of languages should be fixed at creation time. After all, bonus languages (the languages gained from a high intelligence bonus) are fixed at creation time, as are skill ranks. This seems to set a precedent that all choices made for abilities granted by the headband are fixed at creation time.
But this gets weird, very fast. The languages granted by linguistics are different from the other decisions made by the creator, in that there's a different choice to be made for every individual rank of the headband. If we're serious about making these choices at creation time, that means we should have a list of languages that should be taken in a particular order. That seems like a lot of book-keeping, though an interesting compromise position would be that the DM gets to decide on the language learned rather than the player.
Another answer to this question suggested that the creator can only store the knowledge of languages the creator knows. (This was based on the assertion that the creator can also only store the knowledge of skills they know, but I can't find any evidence for that assertion. After all, the wearer of a headband may well have more hit dice than the creator, and thus end up with more skill ranks—and hence more training—than the creator, and so I don't think there's really a solid argument that the creator has to know the skills.) But that would be odd: presumably there would be a point where wearer has exhausted all the languages the creator knew. Would they stop gaining languages as they gain hit dice? That seems odd.
Another possibility is that the creator designates a "pool" of languages associated with the headband. But how large should this pool be? Do you need to designate 34 languages in case Great Old One Hastur kills you and takes your headband? Or 40 in case a Tengu decides to wear your headband? (It has been suggested in another answer that a Tengu's "gifted linguist" racial feature should be overridden; as a player I would be pretty disappointed by that, especially since there doesn't seem to be solid RAW support for it.) Really, the "pool" solution is functionally equivalent to the wearer choosing the languages, and has all the same problems as that solution. (See below.)
Finally, there's the issue of the character's own ranks in linguistics. A character may well take a rank or two in linguistics before acquiring the headband; perhaps they choose orcish and elvish. If the headband doesn't have those two languages, what happens? After all, if the headband's bonus to a skill is better than the player's, the headband's ranks replace the player's own. And so all of a sudden should the player stop knowing the languages they knew previously? Or perhaps they keep their own languages and start on the headband's languages two ranks later?
Assuming you do get the languages... but the wearer gets to choose.
Already, we have to bite the bullet here and rule that linguistics is an exception to the general rule of the headband: choices related to linguistics are the only choices the wearer gets to make. Even though the headband doesn't let you choose a bonus language for intelligence!
If the wearer gets to choose, then the GM has to rule what happens when the wearer takes off the headband and puts it back on a few days later. Do they get to make entirely new choices for the language? Or do they have to stick to the same they chose before?
Intuitively, it seems like the latter has to be the case. Being able to put on a knowledge-granting magic item, take it off for a day, and put it back on and gain knowledge that was different from what you learned before seems very cheesy. It's actually pretty reminiscent of the infamous Paragon Surge, the abuse of which got so bad that they had to make an errata that fixed the choices made by that spell to a 24-hour period.
One could argue that, since there is no explicit errata on this point, that the wearer does indeed get to choose different languages each time. After all, knowing more languages isn't terribly broken, especially if you have to spend 48 hours (24 to unattune to the headband, 24 to re-attune) to make new choices--much longer than the time required by paragon surge. Still, I don't think the grounding here is really solid and it will come down to GM fiat.
If you don't want to let the player do something like this, though, you end up having to rule on a lot of other things. If the player makes their choices and they can't change them, then you also have to rule about what happens if they find a new, better headband (do they get to make different choices this time?). If they don't get to make new choices for a new headband, then you're probably relying on the intuition that the headband "unlocks" knowledge that the plalyer would have had, had they invested ranks in the associated skills. But by extending that logic, if they later lose the headband and take a rank in linguistics themselves, they have to make the same choices they made with the headband potentially many in-game years ago, which seems annoying. (And there's still even weirder solutions: what if they decide to put a manual rank in linguistics while wearing the headband? And what happens if a year after that they lose it?)
The simplest ruling you can give here is that linguistics in a headband doesn't give you the languages normally associated with the skill, based on the interpretation of "put ranks in" discussed above with respect to the debate about familiars. This is the only ruling that does not lead the GM to having to make many other arbitrary rulings down the line.
If you don't want to do that, I would suggest letting the headband grant linguistics, letting the player choose those ranks, and letting them choose the languages each time they re-attune to the headband. This isn't terribly broken, and seems to me to be the second-least arbitrary option.
But really, this doesn't matter. As a commenter pointed out, there are numerous options for using a magic item to speak and understand languages, including a helm of telepathy or a traveler's translator. On top of that, magic users have numerous options available to them: wizards and witches have access to the spell tongues, wizards can make tongues permanent with permanency for only 7500 gold, and witches and shamans have access to a tongues hex. There is no shortage of options for gaining access to language comprehension via magical means.
But it's worse than that. You will never find a headband of vast intelligence in the wild with linguistics as a skill, unless the GM puts it there. Otherwise, the only way this comes up is if a character crafts the headband themselves. But this character could just as well take the linguistics ranks themselves and give some other skill to the headband. They'd only be missing out on one skill until they craft it, which could well be as early as 3rd level.
So, this really isn't a problem, practically speaking. In my own game, I simply ruled that the character should just take "regular" ranks in linguistics, put whatever other skill they would have taken, and that sidesteps the problem entirely. (And in future games, I'm just going to homebrew some non-skill-related system for languages, so I don't have to deal with these questions ever again.)