Vision

Vision describes what a unit can and cannot see from its current location and state. Places a unit cannot see are filled with the Fog of War, a dark mist that hides units inside of it. Invisible units cannot be seen even when outside of the Fog of War, unless they are spotted by a source of True Sight. Units cannot see through trees or to higher elevations - the only exceptions to this rule are flying units, who have unrestricted vision, and Night Stalker/Keeper of the Light with an Aghanim's Scepter at night/day.

All units on your team share vision, which means that if a unit can see through the Fog of War, all allies can as well. This also applies to lane creeps, other controlled creeps, and buildings.

Fog of War
All areas outside of friendly vision are constantly covered by the "Fog of War". Any non-friendly units within the Fog of War cannot be seen or targeted (it is effectively invisible), however they can still be hit by non-targeted spells. To reveal units in the Fog of War, an allied unit must gain vision in that area. Observer Wards provide vision in an area to their team.

If an enemy unit in the Fog of War attacks or targets a spell on a friendly unit, a 100 radius small area around them is revealed for 2 seconds.

Unit Target abilities are cancelled if vision of the target is lost, even if the cast animation already began.

Elevation
Units cannot see areas that are on higher elevations than them, while units on higher ground receive unrestricted vision below. Additionally, any ranged units attacking an enemy on higher elevation have a 25% chance to miss their target.

Trees
Trees also block vision, and can be used to escape enemies by running through small gaps in them (known as "juking"). When trees are cut down or destroyed, they no longer block vision.

Day and night vision ranges
Most units have different vision ranges for the day and night cycles. Generally, units see a lot farther during the day than they do at night.

Heroes
Most heroes have 1800 units of vision during the day, and 800 at night, though there are several exceptions. This makes ganking a lot more viable at night, because heroes can get much closer without being detected. Heroes can increase their night vision by equipping which passively grants  bonus night vision, or consume it to gain  night vision permanently.

Below is a table of all heroes which do not have the standard 1800/800:

Heroes that have abilities that increase their vision: 1 Luna's night vision increases to 1050/1300/1550/1800 upon learning different levels of.

2 Lycan's night vision increases to 1800 during.

3 Winter Wyvern's night vision increases to 1200 during.

Heroes that have talents that increase their night vision: 4 Winter Wyvern's night vision increases to 1700 during with the talent.

Buildings
Allied buildings share vision through the Fog of War with their entire team. Below is a table listing the vision ranges of all buildings:

Neutrals and Summons
Most neutrals and summons have 800 vision during day and night.

Below is a list of neutrals and summons that don't have the standard 800/800 vision.

Flying vision
Flying vision gives unrestricted vision in an area, so it is not blocked by trees or obstacles and can see all elevations.

Note: Night Stalker and Keeper of the Light may have unobstructed vision during night and day correspondingly if they purchase.

Ground vision
Also known as normal unit vision, standard vision, and hero vision. This type of vision is blocked by trees, other obstacles, and elevation. All heroes have ground vision by default.

Shared vision
Some spells share the vision of an enemy unit with your team. Most of these spells allow you to see what the enemy unit sees and some only provide vision over the enemy hero model.

Abilities reducing vision
These abilities lower vision range of different units.