The main theme in this poem by Robert Herrick is one in poetry of Herrick's era, the early 17th century—you may be able to identify points of comparison between this poem and several of Shakespeare's sonnets, for example. The theme Herrick is conveying is that of the transience of life, and particularly life's youth and beauty. In order to convey this, he uses the analogy of a daffodil, not long in bloom, comparing the speed at which the daffodil progresses towards "decay" to the speed with which death comes upon humans.
Herrick intensifies the comparison by personifying the daffodils, whom he addresses as "you" and with whom he imagines praying, as if the daffodils were capable of understanding their short existence as humans are. Towards the end of the poem, he also draws in a second comparison, suggesting that the "hours" of both people and daffodils can be compared to "summer's rain" and "morning dew," both transient and, once evaporated, never to be found again.
Essentially, Herrick is saying that beauty and life itself stay only briefly and then are gone, and there is nothing we can do about it. This is inexorable and is the way of the world for all things.