Joining in new yarn when you are crocheting will either be necessary when one ball ends and you need to join in a fresh on,or you may need to fasten off in one position and re-join elsewhere, to work an edging for example.
Insert the hook as required,wrap the new yarn over it and pull a loop through leaving a 10cm tail. Work 1 ch and then continue the pattern. If you are using a solid stitch you can enclose the tail as you work the next few sts. and then pull it gently and snip off the excess. A more openwork pattern may require that you carefully darn the end in when you have finished, or sew it in when making the garment up.
Where possible always try to join in new yarn at the end of a row. To judge if you have enough yarn left for 2 rows tie a loose overhand knot in the centre of the remaining yarn. Work 1 row and if you need to undo the knot then you won't have enough to complete the 2nd row, in which case fasten off the old ball at the side and join in the new ball.