TL;DR: We don't know specifically what war the Gotham-continuity Gordon fought in, but the trope of Gordon being a war hero and/or ex-military has been around since at least the 80's.
What War was Gotham Referring To?
We don't know. Gordon's past hasn't been discussed much in the show so far. In fact, the dialogue you're referring to is probably this conversation from the pilot:
JIM: She said you had to keep me, huh?
HARVEY: Yeah, she did. She said you were a war hero and your daddy was
a big shot D.A. back in the olden days, so I have to keep my trap shut
and do as I'm told.
HARVEY: Listen, kid, you got juice; do me a favor. Ask for a transfer.
JIM: Sorry, this is where the action is. You'll get used to me.
Given that Gotham isn't assigned to any particular time period, the writers have probably decided to leave such references vague. After all, mentioning a specific conflict would tie the show down time-wise, which is something they're trying to avoid. However, given that the show appears to be a blend of vehicles, technology, & culture from within the past 30 years, we can speculate that "the war" is referring to either Vietnam or one of the numerous conflicts in the Middle East.
Is This Something New or From the Comics?
Actually, the idea of Jim Gordon being ex-military has been around for quite some time - it's just not a major trait of the character. Here are some examples:
- The Dark Knight Returns (1986): An aging Jim Gordon in his 70's makes a reference to serving in WWII, comparing Batman to Franklin Roosevelt.
- Batman: Year One (1987) - Jim Gordon is stated to be former Special Forces in the US Army.
- Gordon has made several references in the comics to having "seen combat", or knowledge of how men react when under heavy fire.
This was also alluded to in the 2012 film "The Dark Knight Rises", during an exchange that takes place when Gordon leaves the room:
Foley: You should spend some more time with the Mayor.
Gordon: Well, that's your department. [walks off]
Congressman: Anyone shown him the crime stats?
Foley: He goes by his gut and it continues to bother him, no matter
what the numbers.
Congressman: Must be popular with his wife.
Foley: Not really. She took the kids and left for Cleveland.
Congressman: Well, he'll have plenty of time for visits. The Mayor's
gonna dump him in the spring.
Foley: But he's a hero...
Congressman: A WAR hero. This is peace-time.
Although some of this could be referring to the "war" against crime, much of it comes together to paint the picture of a military veteran.