It's used as a preposition of time to refer to a finished time period that happened a particular time period in the past. For example, two weeks ago means two weeks before now.
Ago is extremely unusual in English grammar in that it is a preposition that it goes after (postposes) rather than going before (preposing) its prepositional complement. We say two days ago but not *ago two days. Modern grammarians such as Huddleston and Pullum identify it as a preposition, as it becomes the head of a prepositional phrase. Despite this, most dictionaries still label it an adverb.
It's pronounced carefully as /agəʊ/ but quickly as /əgəʊ/.