Does Ohm's law hold in space? My current understanding is this: When current passes through a resistor heat is generated which the resistor then gives off to the surrounding air. That way the resistor is kept at roughly the same temperature so $R $ is constant which makes Ohm's law ($U=IR$) linear.
But in space the resistor doesn't have anywhere to put off the heat!
In that case, will the resistor keep heating?
Will that change its resistance, in turn affecting the $U=IR$ relation?
 A: For Ohm's law to be true the current must be proportional to the voltage so a graph of current against voltage would be a straight line through the origin.
A situation similar to the one that you describe is that of the resistance of a light bulb with the metal filament (a resistor) in an evacuated glass bulb.

As the current increases the electrical power dissipated in the filament increases and the energy is lost as infra-red radiation and visible light.
When the electrical power supplied equals the power lost as electromagnetic radiation the temperature of the filament will be constant.
However increasing the current will raise the temperature of the filament which in turn will increase the resistance $=\dfrac{\rm voltage}{\rm current}$ of the filament.
So the graph of current against voltage is not a straight line through the origin and so Ohm's law is not obeyed.
For small currents when small amounts of power are dissipated the temperature of the filament stays approximately constant and the current vs voltage graph is approximately a straight line, Ohm's law is obeyed approximately.

Update
After doing his experiments Ohm made two statements.
One was that for a "resistor" the voltage divided by the current is a constant which is called resistance.
The second was that the value of the constant (resistance) did not depend on the current.  
I think that a lot of the discussion about the answer to the question is to do with the interpretation of the second statement and the conditions under which Ohm's law is true.
There are many laws in Physics which have conditions which must be satisfied for them to be true.
Conservation of linear momentum is one of them having the caveat that no external forces act.
If the filament in a light bulb is in some way kept at constant temperature so that its dimensions and resistivity did not change then its resistance would stay constant, independent of the current, and Ohm's law would hold.  
However the temperature of the filament might not be increased by ohmic heating but by putting the filament into a bath of hot liquid.
Then it was not the current which was responsible for the temperature rise and if measurements were taken to find the resistance of the filament at this new temperature the resistance would be found to be constant, so Ohm's law holds.  
The other interpretation is that the rise in temperature is due to increased current flowing through the bulb and so the resistance increases because of the increased current which means that Ohm's law does not hold.  
Reading the comments in this post it would appear that opinion is divided as to which is the correct interpretation.
A: The resistor can transfer heat to surroundings in the form of thermal radiation and the power radiated by the object (in this case resistor) is bigger, when the object is hotter. So eventually the resistor will reach a constant temperature and will radiate all the heat into space. In that case, the Ohm's law will still hold.
A: 
But in space the resistor doesn't have anywhere to put off the heat!

Actually, it does. Heat transfer can occur by three means: conduction, convection, and radiation. Very basically, heat conduction is about solid materials touching each other; convection is about gases or liquids touching the heat source; and radiation is about transmission of energy by means of releasing waves or particles. (This doesn't capture all of it, but since you are asking this question, I get the feeling that you aren't very familiar with the subject, and this is hopefully good enough to get you started for the purposes of this answer.)
In an atmosphere, convection is commonly a major mode of heat transfer. It's how every air cooled gadget (whether forced air cooling or ambient air) remains at an appropriate temperature, and it's mostly the way everything eventually ends up at the ambient temperature.
In space, there is no atmosphere, so convection doesn't work for cooling. But there's still conduction and radiation.
Conduction basically just means that if you leave your spacecraft somewhere far away from any heat source, or in an area of uniform heat sources surrounding it, everything within it will eventually have the same temperature. That's not particularly useful for our purposes; in a spacecraft, it's more about heat transfer within the spacecraft structure than to outside of it.
But even with convection and conduction not providing any useful heat transfer to keep our resistor cool, there is still radiation!
And in fact, that's how spacecraft maintain an appropriate temperature: By carefully controlling the heat and energy budget, not uncommonly ensuring that all sides of the spacecraft are exposed roughly equally over time to the heat source (which in our real world cases means the Sun) and matching heat dissipation against heat generation through radiation of excess heat.
For this reason, spacecraft designs include radiators which take heat generated and radiates it into space.

In that case, will the resistor keep heating?

Yes, unless the spacecraft includes radiators or some other way to dump excess heat; which it will, at least if it is intended to work for any length of time.

Will that change its resistance in turn affect the $U=IR$ relation?

Yes and no! This has been pointed out several times in comments, but I see no answer capturing it. Regardless of how exactly it is phrased, Ohm's law is valid only for a snapshot in time. This means that for $U=IR$ to hold as stated, you must simultaneously measure two or three of the quantities involved (voltage, current and resistance); if you measure two, you can calculate the third.
The voltage that is lost through resistance across the resistor becomes heat, which (unless it is somehow released) increases the temperature of the resistor.
Real-world resistors have a tendency to change their resistance when their temperature changes, which means that $R$ changes. In turn, either the voltage across the resistor ($U$), or the current through the resistor ($I$), must change for the equality $U=IR$ to remain valid. But if you were to measure these quantities again a microsecond later, you would find that the equality still holds, albeit with slightly different values for each.
A: Frankly, I didn't see the question answered, although there are many answers with deep details about everything surrounding it.

Does Ohm's law hold in space?

Yes
Ohm's Law holds everywhere, under every condition whatsoever.
But
The law holds always. But there are many different types of components out there, and all of them may be influenced by temperature in a different way. So, yes, even if you heat your particular resistor to 1000°C, Ohm's Law still holds, it is just that your component now has another resistance R than it had at 20°C. 
It's not even clear what your resistor will do - there are some where R rises with temperature (PTC), others where R falls (NTC). There are other causes to change the value of R in a component (for example, light sensitive resistors). They still are resistors (or "ohmic" components) though, and Ohm's Law alawys holds for them, albeit with different values of R for different circumstances.
A: Ohm's law is only concerned with voltage, current, and resistance. In that respect, it is perfectly accurate and complete. However, Ohm's law is not all that comes into consideration for a successful design!
Even in real-world terrestrial applications, you need to account for heat capacity of the material conducting and dissipating the heat, and for the heat dissipation properties (get very complicated very fast; geometry, material properties, ambient temperature, air flow, coolant composition, coolant pressure, etc all come into play here...).
In mundane applications, measurements are often taken at 25C ambient to normalize everything. In that respect, you get fairly accurate measurements so long as the device being measured is capable of dissipating most of the heat it produces. In most applications the rest of the calculations are just not necessary, as the deviation from thermal variations are not enough to affect the mean significantly enough to warrant extra care.
In space, you need to figure out how to dispose (or recycle) every bit of heat you produce. Probes often have specialized radiator elements to radiate surplus heat produced into space. Surprisingly, heat dissipation calculations in space are actually easier, because the overall conditions vary much less than say the seasons on Earth. Also keep in mind conserving some heat is pretty much always mandatory, as many devices on probes could not function in the cold vacuum of space.
Edit
Since there is still confusion about, here is a small example to clear things up.
AWG 24 gauge copper wire at 25C has a resistance of 26.17Ohm per 1000 feet. Now let's say I drive a 100mA load @ 10V on that 1000 feet of wire. At room temperature, the voltage drop across the wire will be 2.617V. That translates to 261.7mW of heat produced. 1000 feet of AWG 24 copper wire weighs ~555g. Copper has a specific heat capacity of 0.376812J/(g-C). That means it will take ~209.13 Joules to increase the temperature of the conductor by 1C. Let's say our coil has the exposed surface to dissipate ~100mW of heat. That means there is still 161.7mW of heat working to increase the temperature of the conductor. 1W = 1J/s. 161.7mJ/s means that in 10000 seconds (~2.77 hours...) the wire will have increased in temperature by 7.73C. Still, if you were to stop time after those 10000 seconds, and start your measurements over, you would find that now with the wire at 32.73C, the resistance would probably be around 27 Ohms per 1000 feet. The load is still drawing 100mA, but the voltage drop is now 2.7V, so now the losses are 270mW. We still can only dissipate 100mW, so you see that it's heating up faster now. 
Yet Ohm's law still holds. R is constant, it is always V/I, no matter what the temperature is. If you measure V, I, and R at the same time, at any point whatsoever, Ohm's law will always hold up. But in order to arrive to the correct real-world answer for a real world resistor, you also need to take into account heat production through loss and dissipation, which are physical factors, and have nothing to do at all with Ohm's law.
Diodes
Diodes are non-linear devices. Here are two graphs from the popular 1N4148 diode's datasheet:

From any point on those graphs you can figure out what the forward or reverse resistance is at 25C, for a given V and I.
A: One can always take a pedantic position and say that the Ohm law never holds as the resistor is always heated to some extent by the Joule heat (even if the resistor is cooled by air), and resistance typically rises with temperature. So the Ohm law is an approximate physical law. In some situations deviations from the Ohm law are very significant, for example in incandescent lamps, which is close to your "space" case.
On the other hand, the formulation of the Ohm law sometimes includes wording "in a given state" (https://en.wikipedia.org/wiki/Ohm's_law#Temperature_effects), but such formulation describes situations that are not seen often in practice. 
