The commonality between "To His Coy Mistress," by Andrew Marvell, and "To the Virgins, to Make Much of Time," by Robert Herrick, is that in both poems, the speaker is using the "carpe diem" theme, which means "seize the day" or "live for today." Basically, the authors are both saying that time flies by quickly: don't waste a minute because once time is gone, so are the opportunities that surround us when we are young.
The major difference I see is that Andrew Marvell is doing his best to woo the woman he is speaking to into having an affair with him. He tells her that by saving her virginity, she may end up taking it to the grave with her: and what a waste! To the typical Cavalier poet, it was about having fun today without worrying about tomorrow.
Marvell speaks of the passing of time, as it races by, and reasons the woman should follow his advice:
But at my back I always hear
Time's winged chariot hurrying near;
And yonder all before us lie
Deserts of vast eternity.
Thy beauty shall no more be found,
Nor, in thy marble vault, shall sound
My echoing song; then worms shall try
That long preserv'd virginity,
And your quaint honour turn to dust,
And into ashes all my lust.
The grave's a fine and private place,
But none I think do there embrace.
Like a demon, time is personified as an entity that races to overcome him, to steal his youth. Vast eternity awaits us all, but he is speaking as to how she will end up there: in what state. She won't be beautiful anymore, he and his song will be gone, her body will deteriorate, as will his lust turn to ash. The grave is all well and good if you want to "get away" (it's a "fine and private place"), but it lends nothing to romance.
Marvell is trying to get this woman to come around to his way of thinking.
Herrick, on the other hand, seems simply to suggest that every person should enjoy youth while he or she may, and never take it for granted. He is giving sound advice, but not because there is something he wants, as does Marvell. Herrick is simply saying youth passes very quickly and then is gone: don't ignore it or waste it, but enjoy it while you may.
...the speaker does not urge “the virgins” simply to frolic adulterously, [as does Marvell] but to seek union in matrimony, thereby uniting the natural cycles of life and death with the rites and ceremonies of Christian worship.
Herrick's take, then, is different than Marvell's:
Although a very common theme in sixteenth- and seventeenth-century verse, and particularly in Cavalier poetry, the association of Christianity and carpe diem is not a traditional one...perhaps “natural” given Herrick’s thirty-two year career as vicar of Dean Prior, an appointment originally bestowed by King Charles I.
In essence, the topic of both poems is the same, but Marvell wants to get a certain young woman into bed (with "no strings"), while Herrick is more interested in warning the young to use their youth wisely, and he is purporting relationships joined not in lust but by marriage.