It's my first time in 5E D&D and I have played 3.5 before as a DM. I am playing as a high elf Rogue at level 1, and because I'm a High Elf I get a wizard cantrip. Can I attack with my rapier then use shocking grasp in the same turn?
The "Attack" action and the "Cast a Spell" action are two completely different actions, you only get 1 action per round barring specific class features. As a result unless otherwise specified no you cannot both cast shocking grasp and attack with a weapon on the same turn. (That is kinda Eldritch Knight's shindig.)
Both attacking and casting a spell use up your action, so there's no way you can do both on the same turn, it's not Two-Weapon Fighting.
The Eldritch Knight Fighter archetype specifically allows you to perform this combination, as do the cantrips presented in the Sword Coast Adventurer's Guide for Bladesinger. Holding a Rapier won't affect your capability of using spells with the other hand in any way if you want to use both during a battle.