As far as why individual Catholics participate in the various liturgies and sacraments, there can be all sorts of reasons, from the highly religious to the merely social or cultural. The Church does have teachings on the subject, though; let's look at those.
As far as going to Mass on Sundays (and some other days): This is a requirement for Catholics. In its discussion of the third commandment ("Remember the sabbath day, to keep it holy"), the Catechism says:
The celebration of Sunday observes the moral commandment inscribed by nature in the human heart to render to God an outward, visible, public, and regular worship "as a sign of his universal beneficence to all." Sunday worship fulfills the moral command of the Old Covenant, taking up its rhythm and spirit in the weekly celebration of the Creator and Redeemer of his people.
(Catechism of the Catholic Church, paragraph 2176)
Sunday, on which by apostolic tradition the paschal mystery is celebrated, must be observed in the universal Church as the primordial holy day of obligation. The following days must also be observed: the Nativity of our Lord Jesus Christ, the Epiphany, the Ascension, the Body and Blood of Christ, Holy Mary the Mother of God, her Immaculate Conception, her Assumption, Saint Joseph, Saint Peter and Saint Paul the Apostles, and All Saints.
(Code of Canon Law, Canon 1246, Section 1)
These additional days are often casually called "holy days of obligation". The Code of Canon Law goes on to lay out certain circumstances in which these days need not be observed, or may be observed on the closest Sunday.
One goes to Mass to worship God, but also to receive the Sacrament of the Eucharist, around which the Mass is centered. Catholics must receive the Eucharist at least once a year (preferably during the Easter season, see canon 920), and it's recommended to receive every time you go to Mass:
It is in keeping with the very meaning of the Eucharist that the faithful, if they have the required dispositions, receive communion when they participate in the Mass.
(Catechism, paragraph 1388)
"If they have the required dispositions" refers to the fact that Catholics are required to fast for an hour before receiving the Eucharist, and that it is considered a mortal sin to receive if one is already in a state of mortal sin.
Thus, the Church requires people to go to Mass at least on every Sunday, and to receive the Eucharist there if possible, as a way to keep fresh in their heart the need to regularly and visibly worship God. For a Catholic to deliberately fail to go to Mass on a holy day of obligation (including Sundays) is, in the view of the Church, to break the third commandment—a mortal sin. Like all mortal sins, if not confessed, this omission does indeed have the potential to prevent the Catholic from entering Heaven:
If [a mortal sin] is not redeemed by repentance and God’s forgiveness, it causes exclusion from Christ’s kingdom and the eternal death of hell, for our freedom has the power to make choices for ever, with no turning back.
(Catechism, paragraph 1861)
Similarly, going to Confession is necessary insofar as one has committed a mortal sin, for just this reason: if mortal sins are not confessed, they will exclude a person from Heaven.
The Church considers Confession very important for this reason, and requires the faithful (after reaching the "age of discretion"; that is, the age at which they're considered old enough to understand the consequences of their actions) to confess their sins at least once a year:
After having reached the age of discretion, each member of the faithful is obliged to confess faithfully his or her grave sins at least once a year.
(Code of Canon Law, canon 989)
This is a purely ecclesiastical law, not a divine law; still, to deliberately flout this rule is not a good thing.
One of the other sacraments you don't mention is baptism. This is certainly required by the Catholic Church; indeed, it's the way that Catholics become Catholics, and it's necessary for reception of any of the other sacraments. Baptism (by water; the Church teaches that there are other sorts of baptism) is the usual and customary way by which people are justified before God; it is necessary for salvation:
The Lord himself affirms that Baptism is necessary for salvation. ... Baptism is necessary for salvation for those to whom the Gospel has been proclaimed and who have had the possibility of asking for this sacrament. The Church does not know of any means other than Baptism that assures entry into eternal beatitude; this is why she takes care not to neglect the mission she has received from the Lord to see that all who can be baptized are "reborn of water and the Spirit."
(Catechism, paragraph 1257)
The other sacraments (Confirmation, Holy Orders, Matrimony, Anointing of the Sick) are not required for salvation; although Confirmation in particular is recommended for adult Catholics, and is required for participation in some of the other sacraments.