On soccer it is common to see winning teams wasting time. Goalies have their own techniques to run out the clock.
In football, indefinitely.
The relevant offence is on page 37 of the 2014/15 FIFA Laws of the Game (emphasis mine):
An indirect free kick is awarded to the opposing team if a goalkeeper, inside his
own penalty area, commits any of the following four offences:
- controls the ball with his hands for more than six seconds before releasing it from his possession
As an aside, the powers that be at FIFA seem to agree that it’s something that ruins the pace and excitement of the game. In futsal, FIFA’s indoor game, which is designed to be as attacking and fast-paced as possible (and requires minimal effort to change the laws), it is illegal to do this with hands or feet.
Page 40 of the 2014/15 FIFA Futsal Laws of the Game (emphasis mine):
An indirect free kick is awarded to the opposing team if a goalkeeper commits any of the following four offences:
- Controls the ball with his hands or feet in his own half of the pitch for more than four seconds