This is illegal and penalized after the 2 minute warning:
NFL Rules 4.7.1 ILLEGAL ACTS
A team is not permitted to conserve time after the two-minute warning of either half by
committing any of these acts:[...]
(d) throwing a backward pass out of bounds;
Outside the two minute warning it is ruled as a ball out of bounds. The ball will be spotted at the point where it crosses the sideline and the gameclock will stop until the ref signaled that the ball has returned to the field of play.
NFL rules 8.7.2 BACKWARD PASS OUT OF BOUNDS
If a backward pass goes out of bounds between the goal lines, the ball is dead (7-6-2-a), and it is next put in play at the inbounds spot. Rule 11 governs if a backward pass is declared dead behind the goal line.
NFL rules 4.4 STOPPING THE GAME CLOCK
The game clock operator shall stop the game clock (timeout) upon a signal by any official or upon the operator’s own positive knowledge:[...]
(c) when the ball is out of bounds;
NFL rules 4.3.2 SCRIMMAGE DOWN
(f) If a fumble or backward pass by any player goes out of bounds, the game clock starts on the Referee’s signal that a ball has been returned to the field of play.
So there is a minimal time gain possible, considering the time it takes for the ref to get the ball when the player is tackled in bounds, at the risk of losing a few yards and possibly the opponents stopping the ball before the sideline and avancing with it (even if it touched the ground in bounds, it still is a life ball)