It's best to let hot foods cool a little bit before moving them to the refrigerator. They can be so hot that they'll warm up surrounding items, or in the freezer, you might end up actually thawing anything adjacent.
That really only matters if you’re putting quite a bit of food in the fridge/freezer. Think a large pot of stew. It’s more guidance for restaurants than people at home.