There are features and APIs that are included in Windows 7 or Windows Server 2008 R2, but not the another. Where can I find a specific list of the differences? Is there anything to especially avoid if the program is to be compatible with both? Naturally, the question can be generalized to any version of Windows and its respective server edition.
In general, the core API set of Windows 7 and Win2K8(R2) are supposed to be near identical. (Vista and the original Win2k8 are supposed to be the same as well...)
We've shipped products that run on both platforms and only had to do a minimal amount of testing on Win2k8 to insure compatibility.
With server OS SKUs, many of the desktop components (e.g. Windows Media Player) are not installed by default. And others may not be available at all (Windows Media Center, and certain shell features). You may have to rely on the user to install the "desktop feature pack" from Control Panel->Programs&Features->Turn Windows Features on/off to get some APIs available.
In any case, the key is to test,test,test....