If one enemy is surprised, and the mage casts flaming sphere next to this surprised enemy, does it have to make the saving throw and take damage for being adjacent to the flaming sphere when the surprise round ends?
Yes (at the end of the surprised enemy's turn)
Note that there isn't really a "surprise round" in D&D 5th edition. Rather, it is just the first round of combat but surprised creatures can't take actions or reactions until after their first turn (see here):
If you're surprised, you can't move or take an action on your first turn of the combat, and you can't take a reaction until that turn ends. A member of a group can be surprised even if the other members aren't.
So the enemy still has a turn, it just can't actually do anything on it's turn. Except take damage from the flaming sphere: Being surprised has no effect on Flaming Sphere, which just states:
Any creature that ends its turn within 5 feet of the sphere must make a Dexterity saving throw. The creature takes 2d6 fire damage on a failed save, or half as much damage on a successful one.