In the NBA, there are two types of free agency: unrestricted and restricted.
Players are eligible for restricted free agency once their rookie deals expire. In order for a team to make a player a restricted free agent, it must offer the player a qualifying offer before the July moratorium. A qualifying offer is a one-year contract with a value that is determined by the player's previous salary. If a team decides not to give a qualifying offer, the player becomes an unrestricted free agent (generally if a player is good, this does not happen).
This year's numbers are determined by the 2015-16 Rookie Scale. The salary given to a player on a qualifying offer varies based on draft position and player usage. Exact numbers can be found by calculating different percentages of a player's rookie contract.
Once players receive a qualifying offer, they can choose to either sign or not sign the qualifying offer, depending on their situation. Kristaps Porzingis, for example, has indicated he will sign the Mavericks' qualifying offer over the summer, according to Shams Charania.
If Porzingis accepts the offer, which will be worth around $4.5 million, he will play for a year under that one-year contract. Porzingis would then hit unrestricted free agency in 2020.
If a player is exiting the fourth year of his rookie contract, teams can also offer a maximum qualifying offer, which is a five-year offer at the maximum salary with 8% raises that is fully guaranteed (no bonuses or incentives). This is very rare.
Players who do not sign the qualifying offer enter restricted free agency. Restricted free agency gives a player's original team the Right of First Refusal. Another team with cap space can give the player an offer sheet for a contract of over two years. Once this bid occurs, the player's original team has three days to exercise its Right of Refusal and match the new team's offer sheet. If the deadline expires, the new team can sign the player to the terms of the offer sheet. For example, if D'Angelo Russell becomes a restricted free agent, the Suns will be able to offer Russell a multi-year contract, which the Nets must then match within three days.
Two-way players are restricted free agents at the end of their contracts provided a team makes a qualifying offer. Their salaries are then based on the previous two-way contract, which means the qualifying offer is basically another two-way contract.