Poker Hand Ranking from Best to Worst
A hand in poker consists of 5 cards, including a number of 'core' cards which determine the rank of a hand. Also, if there are less than 5 core cards, a number of side cards often called kickers are added to bring the total number of cards to 5.
For example, in a Three of a Kind hand JJJQ8, the 3 jokeys are the core cards while Q and 8 are kickers.
In the table below the cards which determine the rank of a hand are placed within a grey box, the rest of the cards are kickers.
Royal Flush 

A sequence of five cards of the same suit from ace to ten. 
Straight Flush 

Any sequence of five cards of the same suit. 
Four of a Kind 

Any four cards of the same rank. 
Full House 

Any three cards of the same rank combined with any two cards of the same rank. 
Flush 

Any five nonconsecutive cards of the same suit. 
Straight 

Any five consecutive cards which are not of the same suit. 
Three of a Kind 

Any three cards of the same rank. 
Two Pair 

A pair of cards of the same rank combined with another pair of cards of the same rank. 
One Pair 

Any two cards of the same rank. 
High Card 

Any other hand. 
Please note, that in variants of poker where a player has more than 5 cards available to form a poker hand, the remaining cards don't affect the ranking. Ranks of poker hands are always based on five cards only, and if these cards are equal then the hands are equal and their owners split the pot.
It's easy to determine the winner when only one player at the table has a hand with the highest rank. If this is not the case, the general rule is: first compare the core cards, then, if necessary, the kickers.
For example, if 2 players have a Three of a Kind hands QQQ86 and JJJQ8, the first hand wins as the rank of it's core cards is Q which is higher than rank of the second hands core cards J. If the hands were QQQJ6 and QQQJ8, than the second hand wins: its last kicker 8 beats the first hands kicker 6.
Below is a more comprehensive set of rules:
▪ Straight Flush: a hand whith the card of the highest rank wins.
▪ One Pair, Three of a Kind, Four of a Kind: compare the ranks of 2 cards forming a pair, 3 cards forming three of a kind or or 4 cards froming four of a kind between hands: the hand with the higher rank wins. If ranks are the same, use the same method as in High Card to compare the remaining cards.
▪ Full House: the hand with highest rank of 3 cards wins, if these are equal, the hand with highest rank of 2 cards wins.
▪ High Card and Flush: sort the cards in each compared hand descending by rank, then compare the sorted cards one by one between the hands. The hand which has a card with the highest rank wins.
▪ Straight: take the card with the highest rank from each compared hand, the hand with a card of highest rank wins.
▪ Two of a Kind: compare the pairs with the higher rank between hands, if their rank is the same then compare the pairs with the lower rank. If their rank is also the same, than compare the ranks of the kickers.
If it's still impossible to determine the winning hand using the methods above, then the compared hands are equally strong and their owners split the pot.