Just like Bear Bibeault said:
getAttribute() is used to fetch scoped variables.
How you scope them? In a serlvet you do request.setAttribute("attrName", attrValue); So you can only use it within the same request. For example, in a servlet you retrieve some data from database, a record, you "scope it" as request attribute, and if your servlet is forwarding the request to another servlet or jsp, you can continue using that scoped attribute.
getParameter() is used to fetch request parameters from the GET query string or POST body.
a) You use it when you need to retrieve params from the query string, for example:
http://hellou.mx?param1=hola¶m2=amigos, request.getParameter("param1") will give you back "hola".
b) You can use it to retrieve params comming from a post (for example, when user submitted an application/x-www-form-urlencoded form).