Just by memory, I think that the new block's timestamp must be:
1. Later than the mean (median?) of the last 11 blocks.
AND
2. Not more than 2 hours into the future, based on the local node's notion of time1.
Requirement 1 means that the clock must move forward, overall.
Requirement 2 is soft. A block rejected by it will be accepted eventually, assuming that a better one doesn't show up first. Globally, it limits a miner's ability to mess with the clock. Without it, a group of miners could agree to run the clock fast, reducing the apparent work, artificially lowering the difficulty, increasing their profits.2
1. Note that this is node time, which is not necessarily the same as the node's OS time or hardware RTC time.
2. If you think that this causes a weakness in the system, work through the implications carefully. The distribution of work between the normal and fast chains is important.