Expanding a little on ltxi's post above... You need to shift while you're pedaling, under light-to-moderate load. If you shift while you're stopped (or while the cranks aren't turning forward), the chain won't actually move to another sprocket until you start pedaling. And when you start pedaling at that point, especially pedaling hard from a dead stop... well, that won't work too well. If you're lucky, you'll just get some skip while the chain moves to the selected chainring or cog. If you're unlucky, your chain could end up getting wedged where it's not supposed to go, causing some damage.
If that's not what you're experiencing, it's certainly possible that worn components are the culprit. Worn chains can cause slippage, like Andy described above. Worn freewheels/cassettes can cause slippage, especially when paired with a new chain. Worn chainrings (the gears up front) don't typically cause slippage like you're describing.