Off the top of my head, my guess would be that the dérailleur and shifter need a bit of adjusting. Depending on how the parts are built, there will be barrel adjusters at both the derailleur and at the shifter. By tightening and loosening those, you pull the derailleur one way or the other so that it more precisely rides on the cogs.
I know that with some cheap indexed shifting systems, it is next to impossible to get it calibrated perfectly - either it will shift up well, or shift down well. Getting it to do both and stay put when in gear gets to be difficult.
Anyway, that's what my first guess would be. But see what others have to say as well.