Normally this would be a simple "take it back to the bike shop" situation, as the bike has not been assembled correctly. But unfortunately you probably have a bicycle shaped object (BSO) that you bought in a box (or was assembled by the proverbial "moron in a hurry"). It's likely that even a BSO can be made to work after a fashion. However you may find that a bike shop will refuse to work on your BSO because they are of such low quality that the shop will be unable to offer warranty on its work.
The easiest problem is that the limit screw on the rear derailleur is not set correctly. This is slightly tricky to explain so if this doesn't help try Sheldon Brown's detailed explaination. Basically, there are two "limit adjustment screws" (one for each limit of the travel) and the one that sets the limit towards the wheel needs to be screwed in a little:
Shift to the largest cog at the back, then without spinning the pedals move the gear shift (twist grip) all the way (to the point where the chain normally falls into the wheel). Now turn the screw until the derailleur pulley lines up with the largest cog on the freewheel. If the derailleur doesn't move when you turn the screw, you're either turning the wrong screw (put it back!) or you're turning it the wrong way (reverse!)
Note on the left hand diagram above there's a line from the pulley to the right hand side of the smallest cog. You're trying to get the mirror image of that line - from the derailler puller to the left-most cog and probably a little to the left of the cog if you want to be really fussy about it.
If you're unlucky this is not the problem at all, and instead you're mounted the derailleur wrong (but normally they're already mounted inside the box), or something has been bent or broken in transit. Maybe use Google image search to look at pictures to make sure it's not something obvious in how it's attached. If it's bent things get tricky, as there are tools to help re-align it and doing that by eye is unlikely to work well (and could break something).
First, try setting the limit screws.
If that works, you might find the adjust rear derailleur answer helps with the next step.