5y old girl with hearing problem, because cochlear problem, on hearing aid for 4 months, no improvement in her language. Best time for cochlear surgery?

Sooner is better. If the child isn't deriving benefit from hearing aids and is having substantial language issues, they should be evaluated for cochlear implant candidacy. This can occur concurrently with the hearing aid trial. The sooner that a deaf child is implanted, the better results. 5 is old already if she hasn't developed language yet. See an ENT specialized in cochlear implantation to get their advice.
Hearing & Speech. I imagine she has a pediatric speech therapist working with her for language and speech issues. 4 months is a brief time and it is unclear where this 5 yo was in her speech & language development before hearing loss and hearing aid use. One hearing aid or 2? Patience is paramount. There are specific indications for cochlea implantation. Seek consultation for specifics for this individual child.