Can I install VS 2010 on a separate development server or does it have to be installed on a sharepoint server to develop webparts?
Not to be mean, but this question has been asked and answered many times on this forum and on other places on the Internet. A quick Google search would have answered your question.
If you want to use the SharePoint tooling in Visual Studio 2010 you must have SharePoint installed locally. Instructions on how to setup a development environment for SharePoint 2010 can be found here.
I'm not certain what you meant by, "or does it have to be installed on a sharepoint server" but installing Visual Studio on your SharePoint production server and doing development there is a very bad idea.
You can, you have two options