There are few common troubles that often come up with regard to Mario-style game jumping.
1. You can't use a FOR-LOOP (or any other loop code) in the jump routine. Reason: It will stall the main loop and prevent program flow from other input from the main loop to be processed; which is essential in a Mario game. The player can effect the jump with the directional input,, as well as the length of the button press that impacts the height of the jump. So you need to use some method to keep track of the Characters State,, like IsJumping, IsFalling or whatever you choose. Your jump routine will need to keep track of variables and character state for the jump without a FOR-LOOP and in order to renter the jump code, and continue where it left off each iteration of your Main Game-Loop. Then those variables need to be reset when the jump is complete.
2. You need to do the same as the above with all input controls,, so that you don't lock up on any one input. Combinations of buttons as well as length of press etc... are crucial. Keeping track of the state of the Character is again important... ie. IsJumping=1,, because you don't want (unless it's a special jump you are purposely including, like later Mario games)... the character to jump again while in mid-air, for example.
3. As far as the formulas for the jump,, I know there is a snippet around here somewhere. The Mario jump is very precise (although not physics accurate.. see caveat below) and takes inertia into account, as well as time/length of button press into consideration. There is also ability to "steer" the jump with directional pads during any point of the jump cycle. All of this made for a much improved and accurate jumping mechanism than was seen in many frustrating platformers prior.
4. Collision detection... generally I've seen problems in the collision detection algorithms, where either the collision from below, collision from above, collision left or right seem to fail. Compensating the offset for detection of the sprite is usually a culprit,, and or, not properly identifying the grid coordinate of the character.
5. helper: There seems to be some helper code in good mario-esque games in which the jump mechanism has some knowledge of the board/level design (mixed with the fact that the levels themselves are well designed with the jump mechanism in mind),, and helps the player getting in tight jumps,, for instance jumping on top of a block. If your angle and jump is within a somewhat flexible but not drastically noticeable tolerance,, the jump routine will make a slight correction and land you atop a the block,, even though the actual angle and height of jump may be slightly off... and actual physics would dictate you hitting the side of the block and thereby not making the jump.
6. The jump is obviously not physics accurate,, and gravity seems to change during the jump at times. Again,, there is a good mario jump snippet on this site that nails this. The jump going up is lofty, and the pull coming down does seem to vary on occasion... allowing for lofty descents,, or quicker free-falls.
Which one are you having issue with???
I'm not a real programmer,, I just play one on the Forums.