On a hot day, when it's cooler outside than in; is it better to put a fan in an open window pointing inwards or outwards?
From a purely temperature point of view, not human perceived level of hotness, it is better to point the fan outward. This is because the fan motor will dissipate some heat, and when the air is blown outwards, this heat goes outside. This is all assuming the room has enough ventillation cracks and the like that the pressure inside is still effectively the same as the pressure outside regardless of what the fan is doing.
Human-perceived hotness is quite different because humans are a heat source themselves and have a built-in evaporative cooling system. Air flow will help with the cooling process and remove heat from the area around the body. A human sitting in a chair in the room with the fan blowing in will feel cooler than with the fan blowing out due to the higher motion of the air in the room.
If the point is to make you in the room feel cooler, blow the air in. The extra power from the fan motor is a miniscule effect in the overall scheme of a normal room in a house and the kind of airflow such a fan would create. Worrying about the fan motor power is really nitpicking, but can be significant for things like cooling chassis of electronics.
Another issue is where the air comes from that enters the room if the fan blows outward. If it is coming from other parts of the same house that are also hot, then that may technically be the most efficient for bringing down the temperature in the whole house, but less useful for just the room in question.
Added
The original question was about blowing air "in" or "out" with a fan. That implied the fan was in a window or such so that inside air would be on one side and outside air on the other.
The more the fan is inside the room, the less effective it will be. Just moving air around inside the room does nothing to cool it. In fact, the extra power from the fan actually heats the room, although very slightly. This can still be useful if the point is to make a human feel cooler.
However, to actually cool the room, the hot air in the room must be swapped for the cooler air outside. With a single fan you only get to force this in one direction, and the other happens thru open windows, doorways, etc. In that sense, the direction of the fan is irrelevant (ignoring the tiny extra power of the fan itself). Cool air will come in, and warm air will go out.
It is best to place the fan in a window or the like where there is a direct connection between the inside and outside air. For best effect, this portal should be sealed around the outside of the fan so that air can't just loop around the fan and not contribute to the overall movement.
If the fan can't be placed right at the inside/outside interface, then it will rapidly become less useful as it is moved into the room. 20 cm (8 inches) inside from a window is enough to make a difference. In that case, blowing the air out is better. That is because the exhaust air of the fan has is in a tighter stream and therefore faster and stays together for a short distance. It if exists the room within this short distance, then a good fraction of the air moved by the fan is still moved outside the room. Again, this effect diminishes rapidly with distance. 20 cm might still be somewhat effective if the fan has a considerably larger diameter than that.
If you can make a duct so that all the air moved by the fan is forced to go outside, then the efficiency increase greatly. Howver, the longer the duct, the more resistance to air movement it creates, and the less overall air the fan moves. Usefulness goes down due to the fan moving less air, even though all the moved air goes outside.
If this all reasonably happens in a steady state, so the air pressure inside the house is constant, then any flow of air out of the window has to be matched by an equal flow in somewhere else, so either way the room is going to cool down: a parcel of cool outside air will replace an equal mass of warm inside air, and the direction of the fan doesn't matter.
The fan is going to set up a current of air through the house regardless.
If there is a heat source inside the house, then a parcel of inside air will still carry the heat from the source to the outside regardless of direction, as long as the source sits in the current of air set up by the fan, but there is a crucial difference in how long the heat from that source remains in the air in the house:
If the house has two open windows and a heat source is near one, clearly a given amount of heat will stay in the house longer if the air current is towards the window that's farther away, as a parcel of air has to travel a longer distance before it's outside; so the heat has more time to dissipate, heating the air that's not directly in the current.
So the house would reasonably be cooler if the fan was pointed at the window closest the heat source.
So if you're sitting by a window with your PC, you're reasonably the largest heat source in the room, and the fan should pointed towards the window closest to you so your heat escapes the house quickly. More effective than pointing the fan out the window would be positioning it so you are in between the fan and the window, since the air current will have a cooling effect on your skin.
If the fan is the heat source, then yes, point it at the closest window. But as a general rule, point it towards the window closest to the heat source.
In addition to the already accepted answer of Olin Lathrop, I'd like to mention that for cooling a room on a hot summer evening it is not only important to cool the air inside, but also to cool the wall structures. A fan directed inside will not only improve the heat transfer from human skin but also from the wall structures. Therefore, I assume that the walls would cool faster with an inward directed fan. This would lead to a more effective cooling of your hot room. For concrete walls the heat conduction inside the walls will be weak. So, it is better to cool the walls from inside than from outsinde.