Glock "generations" are defined by the frame. Not sure about the year cut-off for each frame style, but here is a photo of the first three generation frames, side-by-side:
The first generation guns had a lightly pebbled/stippled finish all the way around the frame. 2nd gen guns had checkering on the front/back of the frame. 3rd gen Glocks have fingergrooves on the front of the frame, and a cross-slot accessory rail on the dust cover portion of the frame (under where the barrel will be when assembled). There are a few so-called "gen 2.5" guns, with fingergrooved frames but no accessory rail, or fingergrooves with no checkered areas in the grooves (just smooth plastic), but these are fairly rare.
The new 4th Gen guns are similar to the 3rd Gen frames, except they have a pattern of little pointy pyramids on the frame sides for a gripping surface instead of the stippling pattern on the gen 3 guns. Gen 4 Glocks also have interchangeable frame backstraps of differing thicknesses to better fit different size hands. This is a Gen4 G17:
If you bought your Glock new, recently, you almost certainly have a Gen 3 or 4; I think the box label will state "Gen4" if it's the newest model.
"Placement is power" -- seen in an article by Stephen A. Camp
(RIP, Mr. Camp; you will be remembered, and missed)