Fair Oaks or Seven Pines on the Virginia Peninsula was in May 1862; Robert E. Lee succeeded to command of what he soon termed the Army of Northern Virginia indicating where he intended for it to operate.
This question is ambiguous. I cannot tell if you are asking a) who took immediate control of Johnston's Confederates or b) who did Jefferson Davis subsequently use to replace Johnston in overall command.
A) G.W. Smith, Major General C.S.A. He lasted a day in command.
B) R.E. Lee, General C.S.A. He lasted until Appomattox Courthouse.
Edit - This is a very good example of how players should respond if they feel a question is ambiguous.
The person who took temporary command immediately after Johnston's wounding was Maj. Gen. Gustavus W. Smith, but shortly thereafter Robert E. Lee took permanent command.
A question very similar to this was asked some years ago, when samgrant was moderator of the trivia game. Sam accepted either Smith or Lee as a correct answer. I plan to follow the precedent he set.
Major Gen. Gustavus Woodson Smith
From Wikipedia:
"Johnston was seriously wounded during the action, and command of the Confederate army devolved temporarily to Maj. Gen. G.W. Smith"
Edit to my answer previously posted:
Immediately following Johnston's wounding on May 31, 1862, Maj. Gen. Gustavus W Smith assumed command. Smith suffered what appeared to be a nervous breakdown and President Jefferson Davis issued orders to place Robert E Lee in command of the ANV on the following day. Lee would hold this position for the remainder of the war.
Answer: General Gustavus Woodson Smith
Ref: Stephen Sears To the Gates of Richmond, page 141 "Then at 8:30 [June 1] that night, as senior officer on the field, he found himself abruptly in command of the Army of Northern Virginia."