Obviously, Italy was a part of the Triple Alliance with Germany and Austria-Hungary before World War I. So what caused the rift and when did it occur? The Italians refused to go on the offensive with the two other members of their alliance when World War I commenced. They argued that the alliance was meant only as a defensive safeguard and Germany and Austria were waging an offensive campaign. Instead, Italy was secretly negotiating with England and France of the Triple Entente (the Allied Powers.) Italy hoped to acquire territory after the war and more was offered by the Entente. The Italians had strengthened diplomatic relations with England and France well before the start of the war, despite being in the Triple Alliance.
Officially, Italy joined the Triple Entente on April 26, 1915 with the London Pact. On May 3rd, they formally left the Triple Alliance and declared war on Austria on May 23rd. It declared war on the other Central Powers later in the year.