@thedorf's advice is VERY inaccurate. For your own good, please ignore what he said. To understand why he is wrong, please reference: http://moz.com/learn/seo/redirection additionally this article talks about the issue a bit more in depth on specific reasoning and logic http://www.hochmanconsultants.com/articles/301-versus-302.shtml
@thedorf @your post revisions: No, if you read the articles in this post you'll understand why you should not do that. Unless the @OP only wants to redirect traffic for a couple days he/she should be using a 301 if it's just a couple days for some quick fix, then yes you could get away with a 302, but it's not recommended. For more specifics, see paragraph below:
For extended website maintenance that may effect your primary domain: A 302 would be appropriate here if you're going to be making significant changes to the website's frontend/backend and don't want users to experience a down/broken website. Then what you would need to do is a conditional redirect via .htaccess. This would involve 302ing all traffic EXCEPT for the web developer or other users who need to see the active work in progress (ideally by IP Address exemptions) SEE EXAMPLE HERE ( http://stackoverflow.com/questions/293285/want-to-redirect-all-visitors-except-for-me ). Following the website updates completion you should revoke the redirect and fix any temporary changes you made to the .htaccess settings. It is possible that your website may suffer ranking wise during this process as 302 doesn't pass link juice and you don't want to 301 and then change back as that would come off as suspicious and could potentially cause Google to red flag your site. If your rankings are hurt, they should (ideally) rebound once you return your website back to normal. However, if you made significant changes to your domain then rankings may move up or down depending on whether or not Google likes these changes. But you'll likely bounce around for a couple days while Google reprocesses your site and then movement should settle down. If you did wide spread changes you'll likely notice a spike in your Crawl rate as Google wants to see the extent of your changes.
@OP: We really need more information on your situation to give you a valid answer, but I've addressed the most common scenarios anyways.
1. Are you setting up 2 separate websites?
a) Primary Domain
b) Secondary domain --> 3rd party website service (if Yes, please see points #4 & #5)
2. If not option #1 above then are you trying to redirect a penalized domain to your new domain?
a) If for churn & burn use a 301
b) If for a long term site you should not redirect at all
3. IDK what the guy above me is talking about in general for passing on Link Juice you would pretty much never want to use a 302 redirect.
4. If you are asking if you move your current domain and redirect to the new host, then you should be using a 301. Doing such will make Domain A no longer rank, but after a while the new domain should inherent most of the link juice, but you may suffer temporarily. A good way to avoid this dip is to in Google Webmaster Tools setup that you are moving domains verify existing domain and delegate the new domain. This will help let Google know you are moving. If domain A is penalized you should definitely NOT use this feature/option.
Domain A --> Redirect --> New Domain
5. Talk to the vendors customer support people. In general most subdomain.wordpress.com or similar style web hosting setups allow you to use your own domain name and that is done through a special DNS configuration. Which they should be able to give you some simple directions on how to do it (if they do support it). If they do not support this feature use a 301 redirect. BUT please note that the http://www.example.com will not show up in the search engine pages but: yoursites-subdomain.example.com will show up.
-----
Sources & References:
Google on 301 redirects (with video) | Matt Cutts also talks about 302 redirects and there uses here in the video: https://support.google.com/webmasters/answer/93633?hl=en
About 302 vs 301 redirects: http://www.seomatrix.com/articles/301-redirects.php