Colored Squares and Cubes

Color each square in a grid, such that no two neighboring squares have the
same color, and each square neighbors any other color only once. (Neighboring
squares share sides  don't consider cornertouching squares to be neighbors.)
What is the minimum number of colors needed for:
 a 3x3 grid?
 a 4x4 grid?
 the plane?

Color each cube in a 3D lattice such that no two neighboring cubes have
the same color, and each cube neighbors any other color only once.
(Neighboring cubes share faces  don't consider corner or edgetouching
cubes to be neighbors.) What is the minimum number of colors needed for:
 a 2x2x2 cube?
 a 3x3x3 cube?
 a 4x4x4 cube?
 3space?
Extra Credit: How do the answers change if we allow wrapping  that is, if
we assume left touches right, top touches bottom, (and front touches back,
for the second part)?
Source: Original.
Solution
Mail to Ken