Temperature in outer space depends on many factors: distance from a star or other cosmic event, whether a point in space is in direct light or shade and if it is subject to a solar flare or solar wind. Variation in the temperature of space near the Earth is primarily based on location and time: Temperatures are drastically different on the light and shaded sides of the planet, which gradually change minute to minute based on the planet's rotation on its axis and its revolution around the sun.
TL;DR (Too Long; Didn't Read)
The average temperature of outer space near Earth is 283.32 kelvins (10.17 degrees Celsius or 50.3 degrees Fahrenheit). In empty, interstellar space, the temperature is just 3 kelvins, not much above absolute zero, which is the coldest anything can ever get.
The average temperature of outer space around the Earth is a balmy 283.32 kelvins (10.17 degrees Celsius or 50.3 degrees Fahrenheit). This is obviously a far cry from more distant space's 3 kelvins above absolute zero. But this relatively mild average masks unbelievably extreme temperature swings. Just past Earth's upper atmosphere, the number of gas molecules drops precipitously to nearly zero, as does pressure. This means there is almost no matter to transfer energy -- but also no matter to buffer direct radiation streaming from the sun. This solar radiation heats the space near Earth to 393.15 kelvins (120 degrees Celsius or 248 degrees Fahrenheit) or higher, while shaded objects plummet to temperatures lower than 173.5 kelvins (minus 100 degrees Celsius or minus 148 degrees Fahrenheit).
The key defining characteristic of outer space is emptiness. Matter in space concentrates into astronomical bodies. The space between these bodies is truly empty -- a near-vacuum where individual atoms may be many miles apart. Heat is the transfer of energy from atom to atom. Under outer space conditions, almost no energy is transferred because of the vast distances involved. The average temperature of empty space between celestial bodies is calculated at 3 kelvins (minus 270.15 degrees Celsius or minus 457.87 degrees Fahrenheit). Absolute zero, the temperature at which absolutely all activity stops, is zero kelvins (minus 273.15 degrees Celsius or minus 459.67 degrees Fahrenheit).
Radiation is energy transferred from an object or event out into space. Cosmic background radiation -- energy scientists believe is left over from the birth of the universe -- is calculated at almost 2.6 kelvins (minus 270.5 degrees Celsius or minus 455 degrees Fahrenheit). This accounts for most of empty space's temperature of 3 kelvins. The rest comes from constant solar energy emitted from stars, intermittent energy from solar flares and intermittent blasts from cosmic events such as supernovas.
Distance, Light and Shade
Distance from stars determines the average temperature of specific points in space. Whether a specific point is fully exposed to light or partially or fully shaded determines its temperature at a specific time. Distance and light exposure are the prime temperature determinants for all objects and points that lack atmosphere and are suspended in near-vacuum.