I'm playing as a half-elf sorcerer. Since my character only has 5 strength, can I take a 5-foot jump over 5-foot pit so as to avoid falling? We are playing on a grid.
According to the PHB page 182 you can do a long jump with a running start of 10 feet as far as your strength score, so 5 feet. A 5 feet jump should be just enough to clear a 5 feet pit, though your DM might require a successful acrobatics check.
But it doesn't really matter, the DM can overrule the rules and if you are not supposed to be able to jump over the pit in order to give your party a challenge than you cannot.
Instead of challenging the DM on the rules ask for clarifications of the rules and then play within the rule-set your DM made (Go around? Use rope? A flying spell? Have a strong PC throw you across? ...) or talk about what rule-set you can agree on.
This boils down to two related issues: if a character can jump five feet, can they clear a pit of exactly that width? And how does the grid change it?
The rules of long jumping are found on Player's Handbook page 182:
When you make a long jump, you cover a number of feet up to your Strength score if you move at least 10 feet on foot immediately before the jump. When you make a standing long jump, you can leap only half that distance.
Sadly, this leaves the issue of distance covered open: there are no ability checks mentioned (but we'll get back to it!), it's essentially either a guaranteed success or a guaranteed failure, but the rules aren't clear which one it should be. I would personally rule in favor of the player, that covering five feet means being able to land safely over a pit exactly five feet wide, but no further. This interpretation is also reasonably consistent with the distance metric used in the sport of long jump.
However, when we take a look at page 175, things get more interesting. A possible use for Athletics check is listed as:
You try to jump an unusually long distance or pull off a stunt midjump.
Therefore, the Strength score should not be interpreted as a hard cap on jump distance, but rather what your character can achieve reliably, 100% of the time. Further than that is possible with a successful Strength (Athletics) check, but it is up to your GM to set the difficulty of this roll. If your GM insists that your character cannot clear a 5-foot pit reliably, you can at least argue that it requires only a slightly better than normal jump (Easy DC) for you to exceed the five feet and cross the pit.
What about the grid?
Strictly speaking, to clear a 5-foot pit that covers an entire grid tile, you would need to be able to jump at least 10 feet.
Rather than moving foot by foot, move square by square on the grid. This means you use your speed in 5-foot segments.
So if you are 2.5 feet away from the pit, you couldn't walk 2.5 feet first, then jump 5 feet, and then move another 2.5 feet. However, if the same pit was shifted so it covered two adjacent halves of two squares, it would be possible as a part of the normal movement. It's fair to say the rules don't make sense in these two instances, so try negotiating for at least an easy Athletics check here with your GM.