The max Lebron can earn is approximately $17 million in the first year of the deal, with raises of approximately $1.8 million per year after that (10.5% of the first year value of the deal), up to a total of six years (assuming that he resigns with the Cavs, or is signed-and-traded.)
If he signs with another team, he can still earn the same $17 million in the first year, with raises of approximately $1.4 million each year (8% of the first year value of the contract), up to a max of five years.