The more important norms of the Code of Canon Law on this matter are highlighted below:
Canon 1108 establishes that only the local Ordinary [the Bishop, the Vicar General, etc.] and the parish priest of the parish in which a marriage is being celebrated have, by virtue of their office, the faculty to assist at that marriage. "Assist" means to be physically present, to ask the parties to express their consent and to receive that consent in the name of the Church. The curate [assistant priest] and the parish deacon need delegation from the Ordinary or the parish priest to assist at marriages. The presence of two witnesses is also required. To be a witness the criteria set by the law must be observed.
Can. 1109 establishes that, apart from exceptional circumstances, the local Ordinary and parish priest assist validly within their territorial jurisdiction not only at the nuptials of those who fall under their jurisdiction but also of those who do not not. In this latter case, however, at least one of the parties must beong to the Latin rite [as distinct from the various Eastern Catholic rites].
Can. 1111 deals more fully with the delegation mentioned in canon 1108. Effectively, the Ordinary or parish priest can delegate priests or deacons to assist at marriages within their territory either for a single case or generally. The validity of the delegation requires that the faculty is to be given to specifically named persons. If it is for a single marriage, then that marriage must be mentioned. If it is a general delegation, it must be given in writing.
If a marriage has been celebrated invalidly because of a defect of form, and provided all other things are as they should be [i.e. that there are no diriment impediments and that true marital consent continues to exist], such a marriage can be "convalidated" by being celebrated again according to the required form [canon 1160].
Other procedures exist to render invalid marriages valid depending on a series of conditions being in place. Since the explanation of these can be quite intricate, it is better to consult the Tribunal or your local priest or deacon in order to deal with any situation of this kind.