The Code of Canon Law states that "One who has received the blessed Eucharist may receive it again on the same day only within a eucharistic celebration [Mass] in which that person participates, without prejudice to the provision of canon 921 §2" (CIC 917). "Even if they have already received Holy Communion that same day, it is nevertheless strongly suggested that in danger of death they should communicate again" (CIC 921 §2).
The Canon Law Letter & Spirit commentary on Canon 917 explains:
The 1917 Code allowed the reception of Holy Communion a second time on the same day only in danger of death or in order to avoid irreverence to the blessed Eucharist. Between the end of Vatican II and the Code this regulation was relaxed. After the promulgation of the Code there was some debate as to whether the word again meant twice only or as often as a person attended Mass. A reply from the Code Commission in 1984 made it clear that it means twice only. Consequently the present law is that a person may receive Holy Communion a second time on the same day, but only on the occasion of participating in a Mass—unless of course there is danger of death. (504)