I am travelling to South Africa transiting via Nairobi before returning to Nairobi after a week, Can the airline hold/keep my luggage for me in Nairobi till I return to Nairobi
No. The airline will not hold luggage for you. Not voluntarily anyway. If you failed to pick up your luggage at the airport, they would probably hold if for a few days providing it didn't go missing. It's not a recommended strategy though.
Ideally you should look for a left luggage service at the airport or in the city. If you're staying at a hotel in Nairobi, it is often possible to leave luggage with them for little or no payment.