TL;DR The DM can rule a normally Medium creature can't assume hydra form using the spell polymorph because a hydra's too big, and the DM can rule that a creature doesn't gain all of the hydra's attacks by assuming hydra form using the spell polymorph because the creature can't gain more attacks due to gaining limbs, or both, but it seems most DM's don't rule this way.
"Can a Wiz7 polymorph into a hydra?": Maybe!
The 4th-level Sor/Wiz spell polymorph [trans] (Player's Handbook 263) says straight away that it's "like alter self, except" that
The new form may be of the same type as the subject or any of the following types: aberration, animal, dragon, fey, giant, humanoid, magical beast, monstrous humanoid, ooze, plant, or vermin. The assumed form can’t have more Hit Dice than your caster level (or the subject’s HD, whichever is lower), to a maximum of 15 HD at 15th level. You can’t cause a subject to assume a form smaller than Fine, nor can you cause a subject to assume an incorporeal or gaseous form. The subject’s creature type and subtype (if any) change to match the new form.
Hence, as a magical beast, the hydra (Monster Manual 155–7) possesses a creature type covered by the polymorph spell, and, as a 7-Hit Die creature, the 7-headed hydra falls within the Hit Dice limit of a level 7 wizard's polymorph spell. However, the hydra's size may still be an issue.
See, the polymorph spell inherits all of the 2nd-level Sor/Wiz spell alter self [trans] (PH 197) except for those items listed in the polymorph spell, so while the polymorph spell "can’t cause a subject to assume a form smaller than Fine," this doesn't, technically, change the size categories that can be assumed using the spell polymorph because of the limits inherited from the alter self spell, and the alter self spell says, "The new form [the caster assumes using the spell] must be within one size category of your [the caster's] normal size."1 …And a typical hydra's size category is Huge. Thus if the subject's normal size category is already Large, Huge, or Gargantuan, then assuming the form of a hydra is totally legit. Whether assuming hydra form is legit if the subject is not normally Large, Huge, or Gargantuan, then, is up to the DM.
However, most folks don't seem to play that the polymorph spell inherits most of the alter self spell's size restrictions: see this ENWorld 2004 thread, this Giant in the Playground 2013 thread, and this foul-mouthed Reddit 2014 thread, for example. Instead, folks seem to read generously the phrase You can’t cause a subject to assume a form smaller than Fine as removing the maximum size category cap from the spell alter self while imposing a minimum size category… just in case the caster ever tries to assume the form of one of the game's nonexistent littler-than-Fine creatures.2
Further, while it is also widely agreed both that the hydra's ability to take a standard action to make an attack with each of its heads or to make an attack with each of its heads at the end of a charge is a natural ability (having not been designated extraordinary, spell-like, or supernatural; also see Natural Abilities on PH 80) and that the alter self spell grants the subject the new form's natural weapons, the alter self spell also says that a new form "with extra limbs does not allow you to make more attacks (or more advantageous two-weapon attacks) than normal." As this also isn't listed as an exception obviated by the spell polymorph, this limitation, too, is technically inherited from the spell alter self by the spell polymorph. This makes it possible for the DM to limit the attacks that a subject that's assumed hydra form can make in a variety of ways—all such ways probably allowing the now-a-hydra creature fewer bite attacks than a typical found-in-the-marshes wild hydra. Again, to be clear, most folks don't seem to have this alter self phrase apply to forms assumed by the polymorph spell, but, technically, it appears to be a thing.3,4
In short, ask the DM.
The far easier action economy answer
The hydra's natural ability to take a standard action to make an attack with each head doesn't change how long it takes a creature that assumes hydra form to cast a spell. That is, after a caster takes a standard action to cast a spell, the caster has left only a move action, a swift action, and a number of free actions that the DM can limit arbitrarily. There's simply no action left after a typical caster takes a standard action to cast the spell polymorph to assume the form of a hydra that the caster can use with which to attack. The caster'll have to wait until his next turn to launch whatever hydra-form-granted attacks the DM's ruled he now has available. (But also see this question.)
1 It can be debated what, exactly, normal here means—the game never providing a clear definition of normal (consider, for example, this question)—, but this DM has always assumed normal usually means absent any other ongoing effects, so, for example, a Medium creature that somehow underwent an instantaneous change to its size category would see a change to its normal size (see below), but a creature that's been the subject of the 1st-level Sor/Wiz spell enlarge person [trans] (PH 226–7) would not see any change to its normal size.
2 If the subject of the spell alter self is itself normally Fine—an unusual occurrence maybe brought about by activating a rod of wonder multiple times and consistently rolling 66–69s—, that creature can assume the forms of nonexistent littler-than-Fine creatures yet it can't assume such forms using the spell polymorph. Yeah, I don't even.
3 None of this, by the way, is technically changed by the latest version of the polymorph subschool errata that's already folded into many unofficial SRDs and that appears here and is identical to that buried in the back of the premium Player's Handbook (2012) and in the Player's Handbook (2003) errata here. This explains generally how such spells that change a creature's form work, but the alter self-polymorph-shapechange line of spell largely have specific rules that leave them untouched by any changes to the underlying polymorph subschool.
4 If it's helpful, according to a chat that's mentioned in this thread—the transcript of which is unavailable even by way of the Internet Archive—this extra-limbs-means-no-attacks-gained-even-if-polymorph-is-used-to-assume-that-form stance seemed to have received tacit support from 3.5 revision architect Andy Collins.