A lot of good points here raised already so I won't repeat them. Some things I wanted to add, though, from an experienced composer's perspective: less is most often more. Especially if you're starting out. It can be easy to get lost in making a lot of additions and putting a whole bunch of complexity (especially if you're a programmer!) together. And it might even sound good on its own (most often not, though. I speak from experience!), but when put into a game it becomes even more distracting. Everyone's been spot on in that it's all about atmosphere. You're writing music that should enhance the scene in the game. If it's not doing anything for it or if it's taking away the attention and distracting the listener then it probably isn't needed. Everything should compliment what's happening on screen.
However, it can also be really easy to make something too simple that gets really repetitive and tires the listener's ear. In this case the more ambient the better. That is, less percussion, lead instruments, rhythm and such and more background slower changes. Pads and soft strings are nice choices for these areas. Monkey Island 2 had music throughout the entire game yes, but many of the areas with music (especially the maps) were far more ambient with little or no actual real themes to speak of. Just background atmosphere that pushed the tone and emotion to exactly where it needed to be to make you feel what the designer wanted you to feel when viewing that scene.
So you can go two route: The early Sierra/Monkey Island 1 style and have no music until an important area. In this case you can keep most music simple with not a lot going on except for maybe the really important scenes which can be more upfront and a little busier. Or you can go the Monkey Island route (MI2 and up, at least) where there is music everywhere but most of it, especially in unimportant areas, are just nice background tracks to compliment the atmosphere of the scenes, then you can get busier with more interesting themes on more important areas. Areas or cues like sudden reveals, first time character or area introductions, important characters, cutscenes, memorable/important locations, etc.
I would suggest, as a first time composer, starting yourself off easy and not giving yourself too much workload by going the early Sierra/Monkey Island 1 route and have little music in the game, save for a few important areas/scenes. You never know how much work you're making for yourself until you start doing it. It can be a big job to do a full game soundtrack, especially if no part of the game is going to be silent. Do yourself a favour and just size down the amount on your plate before digging in. Then when you get some more experience you can see what did work and what didn't after getting feedback and even seeing it for yourself by stepping back after it's all done. Then you can decide the best way to go on your next project. Baby steps! Pace yourself.
Good luck!