Depends whose definitions of 'assist' you use, but FIFA's are:
An assist was awarded to the player who had given the last pass to the goalscorer. In addition, also the last but two holder of the ball could get an assist provided that his action had decisive importance for the goal . After goals from rebounds those players were awarded an assist who had shot on target. After goals scored on penalty or by a directly converted free-kick the fouled player received a point. In case that the goalscorer had laid on the goal for himself (dribble, solo run), no assists were awarded. No assists were awarded, either, if the goalscorer took advantage of a missed pass by an opponent. Where goals resulting from penalties are concerned, the player who is fouled in the area receives an assist point (unless, that is, the player who is fouled subsequently executes the penalty himself)
While Opta's definition simply appears to be:
The final pass or pass-cum-shot leading to the recipient of the ball scoring a goal.