What are the guidelines for holes in joists?
Have a look at this document for a quick reference.  This type of thing will be covered by International Building Code (IBC) and International Residential Code (IRC)


  IBC 2308.8.2 Framing details. 
  
  Joists shall be supported laterally at the ends and at each support by
  solid blocking  except where the ends of the joists are nailed to a
  header, band or rim joist or to an adjoining stud or by other means. 
  Solid blocking shall not be less than 2 inches (51mm) in thickness and
  the full depth of the joist. Notches on the ends of  joists shall not
  exceed one-fourth the joist depth. Holes bored in joists shall not be
  within 2 inches (51 mm) of the top or  bottom of the joist, and the
  diameter of any such hole shall not exceed one-third the depth of the
  joist. Notches in the top  or bottom of joists shall not exceed
  one-sixth the depth and shall not be located in the middle third of
  the span.  
  
  IRC R502.8 Drilling and notching. 
  
  Structural floor members shall not be cut, bored or notched in excess
  of the limitations  specified in this section. See Figure R502.8.  
  
  
  
  IRC R502.8.1 Sawn lumber. 
  
  Notches in solid lumber joists, rafters and beams shall not exceed
  one-sixth of the depth of the  member, shall not be longer than
  one-third of the depth of the member and shall not be located in the
  middle one-third of  the span. Notches at the ends of the member shall
  not exceed one-fourth the depth of the member. The tension side of
  members 4 inches (102 mm) or greater in nominal thickness shall not be
  notched except at the ends of the members. The diameter of holes bored
  or cut into members shall not exceed one-third the depth of the
  member. Holes shall not be closer  than 2 inches (51 mm) to the top or
  bottom of the member, or to any other hole located in the member.
  Where the  member is also notched, the hole shall not be closer than 2
  inches (51 mm) to the notch.   
  
  IRC R502.8.2 Engineered wood products. 
  
  Cuts, notches and holes bored in trusses, laminated veneer lumber, gluelaminated members or I-joists are not permitted unless the effects
  of such penetrations are specifically considered in the  design of the
  member.   
  
  IRC R602.6 Drilling and notching - studs. 
  
  Any stud in an exterior wall or bearing partition may be cut or
  notched to a depth not exceeding 25 percent of its width. Studs in
  nonbearing partitions may be notched to a depth not to exceed 40
  percent  of a single stud width. Any stud may be bored or drilled,
  provided that the diameter of the resulting hole is no greater than 
  40 percent of the stud width, the edge of the hole is no closer than
  5/8 inch (15.9 mm) to the edge of the stud, and the  hole is not
  located in the same section as a cut or notch. See Figures R602.6(1)
  and R602.6(2).  
  
  Exceptions: 
  
  
  A stud may be bored to a diameter not exceeding 60 percent of its width, provided that such studs located in exterior  walls or bearing
  partitions are doubled and that not more than two successive studs are
  bored.  
  Approved stud shoes may be used when installed in accordance with the manufacturers recommendation.  
  
  
  
  
  IRC R602.6.1 Drilling and notching of top plate. 
  
  When piping or ductwork is placed in or partly in an exterior wall or
  interi- or load-bearingwall, necessitating cutting, drilling or
  notching of the top plate by more than 50 percent of its width, a
  galvanized metal tie of not less than 0.054 inches thick (1.37mm)
  (16ga) and 11/2 inches (38mm) wide shall be fastened  to each plate
  across and to each side of the opening with not less than eight 16d
  nails at each side or equivalent. See  Figure R602.6.1. 
  
  Exception: When the entire side of the wall with the notch or cut is covered by wood structural panel sheathing  
  
  IRC R802.7 Cutting and notching. 
  
  Structural roof members shall not be cut, bored or notched in excess
  of the limitations  specified in this section. 
  
  IRC R802.7.1 Sawn lumber. 
  
  Notches in solid lumber joists, rafters and beams shall not exceed
  one-sixth of the depth of the  member, shall not be longer than
  one-third of the depth of the member and shall not be located in the
  middle one-third of  the span. Notches at the ends of the member shall
  not exceed one-fourth the depth of the member. The tension side of 
  members 4 inches (102 mm) or greater in nominal thickness shall not be
  notched except at the ends of the members. The  diameter of the holes
  bored or cut into members shall not exceed one-third the depth of the
  member. Holes shall not be  closer than 2 inches (51mm) to the top or
  bottom of the member, or to any other hole located in the member.
  Where the  member is also notched, the hole shall not be closer than
  inches (51 mm) to the notch.   
  
  Exception: Notches on cantilevered portions of rafters are permitted provided the dimension of the remaining portion of  the
  rafter is not less than 4-inch nominal 102
   mm) and the length of the cantilever does not exceed 24 inches (610mm).   
  
  IRC R802.7.2 Engineered wood products. 
  
  Cuts, notches and holes bored in trusses, structural composite lumber,
  structural glue-laminated members or I-joists are prohibited except
  where permitted by the manufacturer’s recommendations or  where the
  effects of such alterations are specifically considered in the design
  of the member by a registered design  professional.