This article is from the Aviation FAQ, by Geoffrey G. Peck firstname.lastname@example.org with numerous contributions by others.
The key concept here, and in most logging questions, is that the
requirements for LOGGING pilot time (in FAR 61.51) are completely
distinct from the requirements for ACTING as pilot in command.
(1) you are the sole manipulator of the controls, and
(2) you have at least a private certificate for that category
and class of aircraft
you may log the time as pilot in command.
It does _not_ matter whether or not you are in visual or instrument
conditions, nor whether or not you have a "high-performance" endorsement
and are flying an retractable-gear airplane. (If you are flying in IMC
and are not instrument rated, you must have a current, instrument rated
pilot who is rated to fly the aircraft in the plane with you. The
instrument-rated pilot then _acts_ as pilot in command while you fly and
log time as sole manipulator; the other pilot may also log the time spent
in actual instrument conditions as pilot in command.)
Much confusion stems from the long sentence in FAR 61.51(c)(2)(i) which
governs who may log pilot-in-command flight time; this indented,
specially punctuated "translation" of this clause should be helpful:
(i) A recreational, private, or commercial pilot may log as pilot in
command time only that flight time during which that pilot
(1) is the sole manipulator of the controls of an aircraft
for which the pilot is rated, OR
(2) when the pilot is the sole occupant of the aircraft, OR,
(3) except for a recreational pilot, when acting as pilot in
command of an aircraft on which more than one pilot
is required under
(a) the type certification of the aircraft, or
(b) the regulations under which the flight is conducted.
Instrument flight is much easier, as FAR 61.51(c)(4) shows:
(4) Instrument flight time. A pilot may log as instrument flight time
only that time during which he operates the aircraft solely by
reference to instruments, under actual or simulated instrument
flight conditions. ...
OK, so this means that
(1) As a private pilot, you get to _log_ PIC whenever you are the
sole manipulator of the controls of an aircraft for which you are
rated. Note that "rated" in this case means "rating", as in
"airplane, single-engine land", _not_ "endorsement", as in
"high-performance endorsement", or (worse yet) insurance-company
(2) If you're the sole occupant of an aircraft and you hold a
private pilot license or better, even if you aren't rated for
that category and class of aircraft, you can log it as pilot in
command (i.e., you're soloing a glider as a student glider pilot).
(3) As a pilot (doesn't matter what kind), you get to log instrument
flight time whenever you "operate the aircraft solely by reference