Vaporeon, Jolteon, Flareon
Evolving an Eevee without meeting any other requirements/prerequisites, will randomly result in either a Vaporeon, Jolteon, or Flareon with a 1/3 chance of either of them.
Espeon, Umbreon
If you keep Eevee as your buddy for 10km, earn at least 2 candy with it whilst it's your buddy, and then evolve it whilst it's your buddy, it will evolve into either:
- Espeon if evolved during the day.
- Umbreon if evolved during the night.
The 10km and 2 candy requirement is counted across all buddy uses of Eevee. You can earn the kilometers and candy, either intermittently or all at once, whilst changing buddies or keeping it the same.
As long as a total of 10km and 2 candy has been earned whilst Eevee has been a buddy, and you evolve it whilst the Eevee is currently set to your buddy.
Day vs night is determined by the game screen in the overworld/map. It's daytime when it is bright, and nighttime when it's dark:

The times when the game screen changes over varies depending on your GPS and time location.
Leafeon, Glaceon
If you purchase a Moss or Icy Rock from the shop (for 200 coins), place it on a Pokestop (like a Lure), spin the Pokestop, and then evolve Eevee whilst in the radius of the Rock, it will evolve into Leafeon (Moss Rock) or Glaceon (Icy Rock).
The silhouette of Leafeon/Glaceon will appear if these requirements are met prior to evolution - if it doesn't, the requirements are not met and it would evolve into Vaporeon/Jolteon/Flareon.
You can also choose a nickname to force a specific evolution, but this only works once per nickname/evolution.