How to know when to call and when to fold? Unfortunately each situation is unique, so there is no universal advice posted here. Knowing the odds however does give you a significant indicator of what might be the right thing to do.

Before you can know what the odds for calling or folding are, you must know how they are calculated. When you are faced with a situation where you need to determine, wether to risk your chips and call, fold and save the chips to fight for another pot or perhaps even consider a raise, you need to figure out what is the number of your outs. To win the pot at showdown, you need to have the best hand. To know how many outs you have you must calculate how many cards still remain in the deck that will make you the best hand.

For example, if your pocket cards are 9c and 10h, and the flop comes 7c, 8s, 3d, you are now holding what is called an open ended straight. You have almost a straight (7c,8s,9c,10h), promising but still not good enough by itself. However should the turn or river card be any Jack or any 6, it would this mean that you complete your straight, which gives you a fair shot for the best hand

In the example the number of your outs is 8. (Jh,Jd,Jc,Js + 6h,6d,6c,6s)

When calculating the odds you assume that all the unseen cards are still in the deck. That means that even if you are playing against 8 opponents, you assume in you  calculations that apart from the 2 pocket cards that have been dealt to you, all the rest are still available (before the flop). The reason is that since you do not know your opponents cards, you can only calculate the mathematical probability of any given card being dealt from the deck. Please also note that after the flop, you have 2 chances of hitting (turn + river cards), but that after the turn, your odds of hitting are significantly lower as you only have one (1) more card (river) to make your hand.

The calculation for odds in the above mentioned example is as follows:

After the flop, 47 unseen cards still remain in the deck. ( A deck = 52 cards; your 2 pocket cards + the 3 flop cards equal 5 cards seen; 52-5=47 cards still left unseen)

You have 8 outs. Your odds of completing your straight (which doesnt necessarily guarantee you the win!) on either the turn or the river is:

47 - 8 (outs) = 39

1- (39/47) [*the turn card*] x (38/46) [*the river card*] = 31.5%

if you fail to make your hand on the turn, your odds to make your hand on the river are (now there are only 46 cards left unseen as the turn card has been revealed)  46-8=38;

1- (38/46) = 17.4% 

To be able to make a decision between fold,call or bet/raise, you must consider the money staked and the odds.

If your opponent bets an amount that is for example 20% of the pot, with the case of an open ended straight as in the above example,  you should definately call, ass you have a 31.5% chance of making the hand. If your opponent bets an amount that is equal to 45% of the pot for example, according to the calculation above you should fold. You are comparing the cost of the bet against your chances of completing your hand.

In real life however another level of complexity is added. if an opponent bets on the flop, he still has the opportunity to bet again later. He may bet again after the turn card as well as after the river card. These realife odds are called implied odds.

 You should use the odds in a few different ways. For instance if you have already made a hand, and do not want you opponents to make a hand that is better than yours, you must be sure to bet an amount that is higher than what the odds would suggest.

In fact, what you want is not to win every hand (since that is simply impossible) but to catch your opponents in positioons where they are paying over the odds for the cards they are drawing.

The second way is figuring how much to call, or even raise or bet. In reality you must then use the calculated odds + the amounts bet on the flop + how you may expect the betting to continue realistically untill the hand is over. This allows you to actually call more hands than what the mathematical odds against the bet vs. the pot initially suggests.

If you have 10 outs to make a monster and you have reason to believe that if you do indeed make your hand, it is very likely that the pot will grow much larger (as it appears to you that your opponent is also holding a strong hand, for which he is likely to wager a lot of money for).

These calculations, reasoning and sensing the iopponents hand are infact what make poker such a popular game, and also why you are likely to need a lot of practice.

Use the chart below as reference (memorize it..) to help you make the right decision. 

Number
of
Outs 
1
2
3
4
 
5
6
 
7
8
 
9
 
10
11
12
 
13
14
15
 
16
17
18
Percentage 
Turn + River
4.4
8.4
12.5
16.5
STRAIGHT  
20.3
24.1
TWO OVER
27.8
31.5
STRAIGHT
35.0
FLUSH
38.4
41.7
45.0
FLUSH + STRAIGHT
48.1 
51.2
54.1
FLUSH + STRAIGHT
57.0
59.8
62.4
Percentage 
River
2.2
4.3
6.5
8.7
DRAW (INSIDE)
10.9
13.0
CARDS
15.2
17.4
DRAW (OPEN ENDED) 
19.6
DRAW 
21.7
23.9
26.1
DRAW (INSIDE STRAIGHT)
28.3
30.4
32.6
DRAW (OPEN ENDED) 
34.8
37.0
39.1