The object is to have a hand with a total value higher than the dealer's without going over 21. Kings, Queens, Jacks and Tens are worth a value of 10. An Ace has the value of 1 or 11. The remaining cards are counted at face value.
The dealer must always hit on any hand value of 16 or less and stand on any value above 17. The dealer must always stand on hard 17 but the rule on soft 17 varies from table to table. It has become common for the dealer to hit soft 17 since that increases the probability of the dealer (house) winning.