As in movie Saving Private Ryan, in final battle after Americans immobilize the german tank, Tom Hanks shoots inside the tank through the vision hole while others throw grenades inside through the top hatch (which was opened from inside). Assuming infantry could have get that close and would not have specialized antitank equipment, how easily could they kill the crew in real life and how common was that?
It very much depends on which tank and what support it had. Until you specify, I'll give a very general reply.
For instance, shooting at/through the vision slits would be very effective against early tanks, as it meant shooting straight into the tank. Even if a bullet would hit the edge of the slit, some fragments might get through and into the eyes of the crewmember on the other side. Late war tanks tended to use some kind of periscope to avoid this, often with easily replaceable mirrors in cartridges, meaning the crewmember would only be blinded until the periscope was replaced.
Throwing a grenade through the hatch would be one of the most effective and devastating ways of knocking out a tank as the blast and grenade fragments would have few places to go other than into the crew. There are some examples of this happening, but quantifying it would be near-impossible.
Examples: Private Robert Reed (scroll down), Major Peter Waddy and Sgt Frank Mattivi (probably "just" a WP grenade, the story neglects to mention the tank was hit by a bazooka while he was climbing up it).
Once a tank has been immobilized it's very vulnerable, and without support from other tanks or infantry it can be relatively easily destroyed by a skilled anti-tank patrol, provided they can get close enough without being engaged. Many of the early war tanks could be destroyed by relatively small amounts of explosives placed in the right spot, or set alight using Molotov cocktails. When the armour was made thicker and things like air intakes, hatches and exhausts were better protected, heavier explosive charges, bundled grenades, burning jerry cans, armour piercing charges (HEAT) and incendiary/thermite grenades were more useful, as well as white phosphor grenades, which both blinded the crew (same as regular smoke grenades) and produced noxious gasses which might force the crew to bail out.
I've left out rifle grenades, AT-rifles and other longer distance weapons as it's outside of the scope of your question.
To protect themselves against enemy infantry, as well as for personal defense and for use when scouting on foot, tankers were generally equipped with pistols and, when possible, submachine guns, as well as hand grenades (which could be lobbed out of the hatch). Special gun ports suitable for a pistol or submachine gun were often placed in blind spots such as the rear of the turret for this purpose. Some crews would scavenge arms from the battlefield, adding a machinegun or additional submachine guns to their arsenal.
In addition to this, German crews were given some specialized weapons to aid in self-defense, starting with the Kampfpistole, a flaregun modified to fire fragmentation and smoke grenades, and later the Sturmgewehr with Krummlauf, meaning bent barrel, on a ball joint mount. Towards the end of the war, a special port for the Kampfpistole was devised for some vehicles. It was called the Nahverteidigungswaffe, which was a smoke bomb discharger that could also fit a Kampfpistole loaded with signal flares or fragmentation grenades.
This 1943 German instruction film, might interest you, as might this or this 1943 American film – AT section starts around 14:40.
EDIT: Added some examples of grenades thrown into tanks (better sources can be provided).