The time it takes to learn English grammar and the language in general, online or offline, depends on what the student's first language and academic background are. Other factors that affect the time it takes to learn English are the learner's motivation and age.
It can take from some months to some years to learn the rules of grammar. If the learner wants to advance fast, that person should make revising English a daily habit and practice speaking and writing as often as possible. There are no shortcuts to learning grammar, and mastering its rules always takes time and effort.