The 24-year-old, who missed the recent Six Nations championship with a thumb injury, is the west country club's second highest points scorer behind Jon Callard.
He said: "I have been taking my time over the decision to sign a new contract as I wanted to make sure that I would make the correct choice.
"The next few seasons are going to be really important for myself both with Bath and with England in the lead up to the next World Cup.
"I am really looking forward to continuing to work with Brian Ashton (Bath head coach).
"He is one of the main reasons that I decided to stay with Bath as I admire his outlook on how rugby should be played and I believe that he will take Bath places in the not so distant future."
Barkley was ruled out of the Six Nations after dislocating his thumb, but Bath hope he could be available for the Heineken Cup quarter-final at Leicester on April 1.
He said: "I am aiming for a comeback against Leicester in the Heineken Cup. It is not that often that you get to be involved in a Heineken Cup quarter-final.
"However I want to make sure that I am 100 per cent fit otherwise there is no point rushing back before I am completely ready."
Ashton said: "I am delighted to hear that Olly Barkley has decided to commit his immediate future to Bath Rugby.
"He is a very talented back who has already performed well at international level. He is also a world-class goal-kicker and should play a leading role in the development of Bath Rugby over the next couple of seasons."