That depends on where you start counting the generations, and to some extent whether you're referring to AMD cpus or Intel cpus. However, if you're referring to Sandy Bridge and Ivy Bridge, one method for figuring out which one a given laptop has is to look up Sandy Bridge and Ivy Bridge in Wikipedia and find the matching model number.
its the processor name scheme that tells you which generation it is from. for instance, for laptops, if its intel if its i#-2### its sandy bridge, and if its i#-3### its ivy bridge where the 2/3 tell yo8u which generation i series it is.
Looking at the numbers after the hyphen will mostly work, but there are a few exceptions: a few Sandy Bridge-E processors have the i#-3#### naming, and there are some low end Sandy Bridge and Ivy Bridge processors labeled as Pentium or Celeron instead of Core i#.