Super Mario Galaxy 2 is the sequel to Super Mario Galaxy. It's basically a 3D platforming Mario game on Wii. Like in the past there was Super Mario Sunshine for Gamecube and Super Mario 64 for Nintendo 64, there is now Super Mario Galaxy 2. Since the developers weren't done with ideas with Super Mario Galaxy, they made a 1.5 version that soon become Super Mario Galaxy 2 overtime as they kept on adding more and more ideas to the point of where there ended up being 95-99% new content in the game.
Super Mario 64 was inside Princess Peach's castle. Super Mario Sunshine was on Isle Delfino. Super Mario Galaxy & Super Mario Galaxy 2 both take place in space.
Super Mario 64 & Super Mario Galaxy 1 & 2 all have similarities but you're looking at 3 different games when you play them. The main things that are the same are:
-All are 3D
-All are platform genre
-Mario is the lead character
-(SPOILER) You fight Bowser at the end of the game (SPOILER)
As Link0710 said, they developers actually do advise that you play Super Mario Galaxy first before Super Mario Galaxy 2. To add to the 95-99% new content in Super Mario Galaxy 2, it is also a much more difficult game which has been stated more than once by many people, including the lead of the project, Shigeru Miyamoto who is also the creator of Mario. According to a podcast and interview, even he was frustrated while playing a finished product of the game. You should look into Super Mario Galaxy first before heading off to Super Mario Galaxy 2. Both are fantastic games.
own knowledge, wikipedia, gonintendo, owner of Super Mario Galaxy and hopefully soon to be owner of Super Mario Galaxy 2 as well.