You can either use a timer (i.e. "from now until the next second, give the player an upward y velocity; after this second is over, let gravity take effect."), or you could have a counter (which kinda acts like a timer; i.e. "if counter <= 0, let gravity take effect; if counter > 0, give upward y velocity; when jump button is pressed, set counter to 100 (or whatever) and decrement it every update loop"), or if you're doing a more "physically based" jump you can add some amount to the y velocity to make it positive and then let gravity slowly pull it back down.
However, in all of these methods, you're going to probably want to first check if the player is touching the ground when they press jump. If the player is not touching the ground, ignore the press. If the player is touching the ground, go ahead and jump.