In most countries, United States included, you may by default not use content created by others without their permission (this is called copyright). The details may vary between countries but that is the default starting point for all copycat discussions.
Content on both Stack Overflow and Wikipedia is licensed with Creative Commons Attribution-ShareAlike 3.0 Unported. This allows copying and modification by others, even for commercial use, as long as all copies keep the same license and specify the source. You may therefore freely copy text from Wikipedia as long as you include a link back to the article.
Other sources than Wikipedia may be more troublesome. Large text blocks may not be copied due to the "deny by default" nature of copyright laws. The easiest thing is usually to ask the original author of the text for permission, and that permission should include the rights to adapt and share the work under the Creative Commons license mentioned above. The Stack Exchange interface does unfortunately not provide fields to include information about such permissions so in some cases you may just choose to rewrite the text yourself.
Most countries, however, allows text quotations (covered in the U.S. by the broader term fair use). This should usually be small parts of text (maybe one or two sentences) and clearly laid out as citations with quotation marks and source info.
Hence:
- All copied content must always have a link or other clear source information.
- Content which is not licensed as
Creative Commons Attribution-ShareAlike 3.0 Unported
must be quotations (use quotation marks!) and not too long (generally only a couple of sentences).
- This applies even if no copyright © symbol is visible at the original location.
- It also applies to content without a clearly specified author.
Anything which does not follow these guidelines should be either rejected or improved to include the correct source info.
Some useful resources: