This is not really about different material panels, but entirely different materials altogether you are editing.
Materials always belong to a certain render engine and are mostly incompatible between each other; and can't for the most part be used for other render engines (with the possible exception of Blender Internal and Blender Game Engine).
The materials shown in your screenshots belong to different render engines. The first one is a Blender Internal/Game Engine material, the second one is a Cycles material. The panel appearance varies according to the active material and hence the render engine they belong to.
You must switch render engines, and stick with your choice. You can't jump around at will. Also switching engines alone is not enough to change the whole panel, materials also differ depending on the active render engine at the time their of creation.