Gradual changes in volume are indicated by the crescendo (meaning a gradual increase in volume) and the diminuendo (meaning a gradual decrease in volume). Listen to the way they are applied to the scale in the following example.
Learning to use dynamics effectively takes quite a while. A good way to practice dynamics is to play a basic rhythm (e.g., two bars of eighth notes) on one note but at different dynamic levels, ranging from as softly as you can play to as loudly as you can play. Then try the same thing with a short melody. These two extremes are not so difficult, although keeping all the notes consistent when playing very quietly can be tricky at first. Most beginners have trouble making the grades of volume in between pp and f distinguishable, so be patient and keep practicing until you are comfortable with all the dynamic levels introduced in this section.
Once you are comfortable with different dynamic levels, start adding crescendos and diminuendos. Again, start with one note until you are comfortable with gradual and consistent volume changes, then try crescendos and diminuendos with scales and finally with melodies. An instrumentalist with good control of dynamics and time will always be in demand with other musicians and well appreciated by audiences.
Here is a sixteenth note study by Czerny. It contains several dynamic markings including a crescendo over two bars. The way you use dynamics can make a huge difference to the feeling of the music and the response it evokes in a listener.