Every time I upload a photo to facebook I'm disappointed; the photos just look really bad. What size do you recommend, dpi, etc? If it helps, I'm using lightroom.
Facebook apparently applies a low pass filter (slight blur) to your images to make sure they compress better (or at least they used to), and then recompresses them at a higher ratio. The reason for blurring is that for a given jpeg quality (quantization) setting the more fine details you have the higher the filesize ends up being as these high frequency components can't be removed by the jpeg compression algorithm.
I wrote a custom action to prep images for facebook which identifies the out of focus areas, and blurs these whilst increases sharpening of other areas. This works for any system which compresses images to a fixed final filesize, as bits saved from the blurred areas are put to use providing more detail to the important areas!
For photos with a shallow depth of field this dramatically improves the overall quality without increasing the filesize.
Facebook's current maximum image viewing size is 720 pixels on the long edge (or both edges for square images.
I export at 100% JPEG quality, 72 DPI (though this is mostly irrelevant), and use Sharpen for Screen - Standard to sharpen them subtly after Lightroom resizes them.
Here is an example of the result that Facebook ends up with a sharp, high dynamic range photograph. Saved from Facebook and re-uploaded to here.
In this case, DPI is very likely irrelevant. DPI (dots per inch) is about how many pixels in each direction fit in a given physical distance, and that is mostly a function of the user's monitor.
If the picture is, say, 700 px wide, then it will always be 700 px wide regardless of whether the image claims 72 dpi or 300 dpi. A commonly cited number is that monitors have 72 dpi, but I'm not sure how accurate that is these days. Assuming for a second that it is accurate, the 700 px wide image would be 700 px / 72 dpi = about 9.72 inches wide, physically.
The DPI setting of the image might very well matter in desktop publishing software, word processors, and so on, that actually target their output primarily towards print, but I think it's pretty safe to say that web browsers ignore it.
You should find out how large the image ends up being, and make it that size. That way it won't be resized, which reduces the sharpness.
Try to find out the maximum file size allowed, and adjust the quality setting to get below that size. Otherwise just save at best quality and let them reduce it when uploaded.
The PPI setting (often called DPI) is irrelevant for images that is shown on the screen. They are always sized according to pixels, not inches.
I usually export at 1440px (longest side), with strong sharpening. This is a 2x oversampling of the 720px that will be visible on the Facebook page. I got the best results this way (better than uploading a sharpened 720px image).
Note that it is a recommended sharpening method, to sharpen an image at exactly twice the final size and then downsize it accordingly. That way you get a very detailed result. The downsampling in this case is done by Facebook itself.
Note that people will be able to download that higher-res 1440px image as it is made available by Facebook (don't know if this can be avoided), and perhaps you don't want to publish that higher resolution image...
Today -- 2-29-12 -- I was messing around with Facebook's new Timeline conversion, since they're making us go there anyway, and could not get decent image quality AT ALL. What I finally did that seems to have worked really well is created an image that was exactly THREE TIMES the 72 ppi resolution -- 216 ppi -- and I left it at exactly five inches wide. (I wasn't going to screw around with also trying to figure out the physical size aspect.) Anyway, that worked really well and my final main Timeline image looked FAR sharper than it had before. FB definitely does some tweaking to the images we upload; this approach seems to have worked very well. Good luck....
I am not a photographer but I have experience with images for the web, including uploading images to facebook. It is my experience that what facebook does is resize an image based on the ratio between its KB size and its dimension (similar to what @Guffa said). For example, if an image is 815x315 and under 60kb Facebook wont touch it (at least not that I could notice). But if you upload a 100 kb image with the same dimensions Facebook will run it thru its JPEG compression).
What I do is save it as 72dpi JPEG at 100% quality (optimize checked) then run it thru www.jpegmini.com. So I don't know if @Matt Grum will share his action, but what he is essentially doing is actually the heart of the JPEGmini "trick".