It was announced as part of her three-day visit to Africa and will form part of a contribution through the Clean Energy Technology Fund to a $500 million (£385m) investment by the World Bank and the African Development Bank in partnership with the Government of South Africa.
Battery storage allows consumers to store electricity to be used at a later time, especially when demand for power from the grid is high.
The UK Government also announced the next phase of the UK-Nigeria Climate Finance Accelerator, which matches government, project developers, finance market players from Nigeria with experts in climate finance and investment in green energy from London.
The UK can share expertise with the West African country on how to invest in green projects, from increasing its renewable capacity to improving the resilience of food chains.
Mrs May also committed £1.5 million to a new research fund to help African researchers study the effects of climate change and a further £500,000 boost for the Africa Prize for Engineering Innovation, which encourages engineers to develop solutions to local challenges.
She also pledged to provide new investment of up to £300 million to build essential power, roads and water infrastructure in Africa.
They are part of a package of measures supported by the government, which are expected to improve skills in big data, artificial intelligence and clean energy and build economic ties between the UK and Africa.