Heat is transmitted through conduction (touch), convection (flowing) and radiation (rays).
With our hand above the flame we will receive heat from both radiation and convection. The convected heat flow is upwards. The hottest part of a flame is the position where most intense combustion is occurring. If you look at a flame there is usually a small more transparent area near the base of the flame. The boundary between this and the bright area above at the centre of the flame is the hottest area. With our hand above the flame receives heat by convection and hottest area of the flame comes in contact with our hand directly and it will burn.
When we hold our hand beside a flame the radiated heat will reach us (it radiates out in all directions like the light), but not much of the convected heat, and we will not get heat from convection unless a burning spark flies out and comes in contact with us directly.
Hence we cannot keep our palm above a burning candle but can keep it on the sides of a candle flame