Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
It looks like it, but as there were different models available in 2007, you need to provide more info or look for yourself at the system requirements of that Lego game.

Link to system requirements found via SEARCH for "lego game harry potter pc requirements"
Link to a listing of all existing iMacs


How to find out what iMac you have:

Look for the Model Identifier, then go here.
4707069290_6547e29211_b.jpg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.