If the distinction is important it will be made clear from the wording, or through the context. Otherwise we just don't feel the need for it. You'll get used to it :)
In this case "jag har lärt mig svenska i tre månader" would be "I have been learning Swedish for three months". "i tre månader" and "in three months" don't mean the same, much to the confusing of language learners... Instead, "jag har lärt mig svenska på tre månader" would be "I have learnt Swedish in three months". So the different prepositions make the distinction here.