Slide two tiles with the same number into each other and they become one tile of double the value. A tile merges at most once per move.
Every move slides all the tiles as far as they will go in the direction you chose. When two tiles with the same number collide, they merge into a single tile worth their sum: 2 and 2 make 4, 4 and 4 make 8, and so on up to 2048.
Only equal tiles merge
A 2 will not merge with a 4. Different numbers just stop against each other, which is how a board fills up.
Once per move
A tile made by a merge cannot merge again on the same move. A row of 4, 4, 8 slid left becomes 8, 8, not 16. You need another move for the two 8s to merge. See what happens with three matching tiles in a row, and the 2048 strategy guide for how to use merges to build a chain. The full 2048 rules cover the rest.