In a Major League Baseball game, Starting Pitchers can pitch as many innings as needed, it is up to the discretion of his Manager however Starting Pitchers must pitch 5 innings in order to qualify for a win.
There is no limit in regards to how many innings a Starting Pitcher must pitch in the Major League Baseball All Star game, a team can be winning and the Starting Pitcher could pitch only 2 innings but because All Star games have different rules, they can be given the Win.
A starting pitcher needs to pitch at least 5 innings to get the win. Any subsequent pitcher can get the win even if he only retires one batter (or base runner). If the starting pitcher leaves with the lead but without pitching 5 innings, and his team maintains that lead, the official scorer can decide which pitcher to give the win to.
The winning pitcher is determined by the official scorer, if the starting pitcher's team is in the lead and never gives up the lead for the remainder of the game. If not, the winning pitcher is the pitcher of record when his team takes and keeps the lead. To be the "winning pitcher", the starting pitcher must pitch five complete innings in a game that is scheduled for six or more innings.
A starting pitcher most pitch 6.2 innings of regulated play with the lead or retake the lead at any point with less then half the game to play ...
If pitchers' team is ahead when he leaves the game (all runners left on base that score, are charged to the pitcher that left them on base), he gets the win. The pitcher must pitch at least 5 innings in a game over 6 innings to get the win. If it is a tie game and the relieving pitcher's team wins, relieving pitcher gets the win. Otherwise he is charged with the loss. If the relieving pitcher's team is winning when he enters as a pitcher and then loses the game, the relieving pitcher is charged with a loss. If the relieving pitcher's team is winning when he enters the game as a pitcher and wins, the relieving pitcher is given a Save.
He must pitch a minimum of 5 complete innings.