Usually there are four officials at a professional football game. There is one referee, who is the highest authority on the pitch and whose job is to ensure that the game is played according to the laws of the sport. It is the referee's role to judge when an incident has breached these laws and to decide what action (and/or punishment) should be taken as a result.
In addition, the referee has two linesmen who assist him in this role and who will normally be in charge of determining when a player is offside (because they have a better view from the sideline). The linesmen also assist and offer an insight to the referee if a foul has occurred in their vicinity. A fourth official is present on the sideline next to the dug-outs, to manage the substitutions and additional time.
Recently, in the light of some high-profile incorrect goal-line decisions in some European matches and International matches. Fifth and sixth officials have been stationed behind each goal. These officials can more accurately judge any penalty box or goal-line incidents and therefore help the referee make a potentially match-changing decision.
Many people are not satisfied with this, and so FIFA is now looking at the possibility of goal-line technology to further aid the referees when it comes to deciding when a goal has been scored or not.
Amateur games have 3 officials, professional games have 4 and some European and International matches have up to 6.