Only if you need to.
I really think it’s a good idea for authors get some sort of editorial feedback on their manuscript and/or query letter from someone they trust before trying to find an agent. That could be a significant other, a critique partner, a friend, a mortal enemy… someone. The advice should be positive, useful, strike you with the occasional, “Why didn’t I see that?!” moment, and, perhaps most importantly, should be consistent with your vision for the project. In other words, the critiquer shouldn’t simply be telling you how they would have written it.
On the other hand, if you don’t have someone you can show your work to and you need feedback or if you would like some input from someone who has worked in the business: by all means, consider a freelance editor. There are some wildly talented editors out there who can really help authors with their manuscripts for a fee.
However, before you mortgage the farm to pay a freelance editor, keep the following in mind:
1) Don’t spend any amount of money you can’t afford to lose. If it feels like too much money it is definitely too much money. Feedback is helpful, but not at the expense of funds that could be better used elsewhere. If you can spare it and it won’t hurt a whit, go for it. Otherwise: there are plenty of free ways to get good feedback.
2) Check the editor’s credentials. Find out what their experience is, who they’ve worked with in the past, and whether the amount they are charging is commensurate with their experience. Do your research and only work with an editor with whom you are completely comfortable.
3) Bear in mind that the mere fact that you’ve worked with an editor is not going to boost your chances with an agent (or at least, not with me). A few agents I have been on panels with feel that it is a benefit if an author has worked with an editor. Me? Not so much. I assume an author received feedback and edited accordingly to make it better. I don’t think you get a bonus because you paid for it.
4) Agents don’t care about typos. Copyediting is not really very necessary prior to submitting to agents. Barring a learning disability, your own grammar and spell-check-assisted spelling skills should be sufficient to ensure that your manuscript has only the occasional typo, which an agent will not worry about.
5) Do not let an editor submit to agents on your behalf. I occasionally get submissions directly from paid editors who submit for their clients. This is a really, really bad idea. I want to hear directly from the author I’m potentially going to be working with. If you’re going to engage an editor, do so only for manuscript feedback. You should be handling the rest on your own.
6) Know what you’re paying for. Make sure you have a very clear understanding of what you’re paying for and what you’re getting up front. Make sure you and the editor have a clear understanding about what you hope to get out of the edit. And make sure you’re communicating well.
7) Watch out for scams. There are quite a few unscrupulous fake agents and fake editors out there. Google the person you’re thinking of working with, and, again, check their credentials. Beware of anyone overpromsing what they can really deliver.
8) There’s no magic bullet. Keep your expectations in check. The editor is helping you with your manuscript: it’s up to you to make the changes, and their help is no guarantee that your project will find representation or publication. The goal is to help you improve your manuscript, but the rest is ultimately up to you.
Basically: Do your research, keep your eyes open, but don’t be overly paranoid either. There are freelance editors out there who provide a valuable service, and assuming you find the right match their feedback can be a real help as you keep on plugging away toward representation.