Portia and Rosalind are both heroines of Shakespearean comedies. They are both high born, clever, witty, and resourceful. They also both have male authority figures dictating their lives: the instructions in Portia's father's will mean that he is determining who she will marry even from beyond the grave, while Rosalind's uncle forces her to leave home by exiling her from his court.
Another significant similarity is that they both disguise themselves as men. Rosalind takes on the persona of Ganymede when she flees into the forest as a means of protecting herself. As a woman, she would be too vulnerable to attack. While in the forest, she incites the love of a shepherdess who believes her to be a man, and tutors Orlando, who also does not know it's her, in how to love her as a woman.
Portia's reasons for donning her disguise are quite different, and she spends far less time masquerading as a man than Rosalind does. She has already secured the love of Bassanio when she takes on the persona of Balthazar, so there are fewer of the comic instances of mistaken identity that can be found in As You Like It. Portia takes on this disguise not for her own protection but to help Antonio, her beloved's good friend, by pretending to be a lawyer and defending him before the Duke of Venice.
Both Rosalind and Portia are wellborn, attractive, and self-possessed young women. Both are witty, intelligent, strong, and good-natured, and both are in love. Both have female companions and both disguise themselves as men, Rosalind as Ganymede, Portia as a male lawyer. By showing the women passing so successfully as men, the play calls into question traditional gender roles.
One difference, however, is the purpose behind the disguises. Rosalind dresses as a man because it will make the passage through the forest safer: it is a means of self protection. Portia disguises herself to help somebody; her skill at arguing saves the life of her beloved's close friend Antonio. The different tones of the plays also lend a different cast to the two characters. Merchant is a darker comedy, and Portia's ability to argue effectively lends her character a more serious and earnest tone, as the life of Antonio is at stake. However, in both plays, the deserving women end up with their desired man.
As in all comparisons, start with the basics. Both characters are female, and both are young. This allows them to pass for (young) men, which they do: both characters engage in disguises. Both also manipulate men for some advantage, using a combination of the disguise, period attitudes towards trusting men (over women), and their own verbal skills. Both have good natures.
Both live in worlds governed by formal rules, and both characters are placed in plays where there is some trouble/upheaval with the system creating the rules. What's more, both have their fates decided at least in part by games played by men (the wrestling, the caskets).
As for differences, these are clear too, and we should start with the basics. Rosalind takes on disguise for self-protection, and stays in it longer. She also seems to get a kick out of the disguise. Portia takes on a disguise to help Antonio, and seems more focused there.