Fast I'm japanese. but my English is poor.
”wakatta" means "follow you","just now I understand","OK" case by case.
"wakatteru" means "I have already understood(known)", "Of course".
"wakarimashita" is civil."wakarimashita" means "wakatta"
If you meet a older than you ,you say "wakarimashita", not "wakatta".